@safe-engine/cocos 2.6.2 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ export declare const SharedDragonBonesManager: {
2
+ isLoaded: boolean;
3
+ factory: any;
4
+ assets: {};
5
+ loadAssetsOnce: (key: any, texJsonUrl: any, texPngUrl: any) => void;
6
+ buildArmatureDisplay: (key: any) => any;
7
+ };
8
+ export declare const PixiDragonBonesSprite: any;
9
+ //# sourceMappingURL=PixiDragonBonesSprite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PixiDragonBonesSprite.d.ts","sourceRoot":"","sources":["../../src/dragonbones/PixiDragonBonesSprite.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;;;;;CA8BpC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,GA+DlC,CAAA"}
@@ -0,0 +1,82 @@
1
+ export const SharedDragonBonesManager = {
2
+ isLoaded: false,
3
+ factory: dragonBones.PixiFactory.factory,
4
+ assets: {},
5
+ loadAssetsOnce: function (key, texJsonUrl, texPngUrl) {
6
+ if (this.assets[key]) {
7
+ return;
8
+ }
9
+ const loader = new PIXI.Loader();
10
+ loader
11
+ .add(`ske${key}`, key)
12
+ .add(`texJson${key}`, texJsonUrl)
13
+ .add(`texPng${key}`, texPngUrl)
14
+ .load((loader, resources) => {
15
+ const dragonData = this.factory.parseDragonBonesData(resources[`ske${key}`].data, key);
16
+ this.factory.parseTextureAtlasData(resources[`texJson${key}`].data, resources[`texPng${key}`].texture, key);
17
+ this.assets[key] = {
18
+ dragonData,
19
+ texture: resources[`texPng${key}`].texture,
20
+ };
21
+ });
22
+ },
23
+ buildArmatureDisplay: function (key) {
24
+ // console.log(this.assets[key])
25
+ const { armatureNames } = this.assets[key].dragonData;
26
+ const armatureName = armatureNames[0];
27
+ return this.factory.buildArmatureDisplay(armatureName, key);
28
+ },
29
+ };
30
+ export const PixiDragonBonesSprite = cc.Sprite.extend({
31
+ ctor: function (config) {
32
+ this._super();
33
+ this._canvas = document.createElement('canvas');
34
+ this._canvas.width = config.width || 1024;
35
+ this._canvas.height = config.height || 1024;
36
+ this._pixiApp = new PIXI.Application({
37
+ view: this._canvas,
38
+ width: this._canvas.width,
39
+ height: this._canvas.height,
40
+ backgroundAlpha: 0, // nền trong suốt
41
+ transparent: true, // bắt buộc để alpha hoạt động
42
+ clearBeforeRender: true, // xoá trước khi vẽ frame mới
43
+ preserveDrawingBuffer: true, // giúp lấy ảnh từ canvas
44
+ antialias: true,
45
+ });
46
+ this._texture = new cc.Texture2D();
47
+ this._texture.initWithElement(this._canvas);
48
+ this._texture.handleLoadedTexture();
49
+ this.initWithTexture(this._texture);
50
+ this._config = config;
51
+ this._armatureDisplay = null;
52
+ this._setupArmature();
53
+ // this.schedule(this.updateTexture, 1 / 30);
54
+ },
55
+ _setupArmature: function () {
56
+ const display = SharedDragonBonesManager.buildArmatureDisplay(this._config.ske);
57
+ if (!display) {
58
+ console.error('Không thể build armature:', this._config.armatureName);
59
+ return;
60
+ }
61
+ display.animation.play(this._config.animationName, 0, this._config.playTimes);
62
+ display.x = this._canvas.width / 2;
63
+ display.y = this._canvas.height / 2;
64
+ display.scale.set(this._config.scale || 1);
65
+ this._pixiApp.stage.addChild(display);
66
+ this._armatureDisplay = display;
67
+ },
68
+ updateTexture: function () {
69
+ if (this._armatureDisplay) {
70
+ this._pixiApp.renderer.render(this._pixiApp.stage);
71
+ this._texture.initWithElement(this._canvas);
72
+ this._texture.handleLoadedTexture();
73
+ this.setTexture(this._texture);
74
+ }
75
+ },
76
+ onExit: function () {
77
+ // this.unschedule(this.updateTexture);
78
+ this._pixiApp.destroy(true, { children: true });
79
+ this._canvas.remove();
80
+ this._super();
81
+ },
82
+ });
@@ -54,24 +54,9 @@ interface ScrollViewProps {
54
54
  isScrollToTop?: boolean;
55
55
  isBounced?: boolean;
56
56
  }
57
- export declare class ScrollViewComp extends ComponentX<ScrollViewProps & BaseComponentProps<ScrollViewComp>, cc.ScrollView> {
57
+ export declare class ScrollViewComp extends ComponentX<ScrollViewProps & BaseComponentProps<ScrollViewComp>, ccui.ScrollView> {
58
58
  zoom(scale: number): void;
59
59
  }
60
- export declare enum ListViewDirection {
61
- NONE,
62
- HORIZONTAL,
63
- VERTICAL,
64
- BOTH
65
- }
66
- interface ListViewProps {
67
- viewSize: Size;
68
- contentSize: Size;
69
- direction?: ListViewDirection;
70
- isScrollToTop?: boolean;
71
- isBounced?: boolean;
72
- }
73
- export declare class ListViewComp extends ComponentX<ListViewProps & BaseComponentProps<ListViewComp>, ccui.ScrollView> {
74
- }
75
60
  interface InputCompProps {
76
61
  placeHolder?: string;
77
62
  font?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"GUIComponent.d.ts","sourceRoot":"","sources":["../../src/gui/GUIComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,IAAI,CAAA;AACpD,OAAO,EAAE,UAAU,EAAU,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEzC,eAAO,MAAM,QAAQ;;;;CAIpB,CAAA;AAID,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5C,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;CACvC;AACD,qBAAa,UAAW,SAAQ,UAAU,CAAC,eAAe,GAAG,kBAAkB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACvG,IAAI,WAAW,WAEd;IAED,IAAI,WAAW,CAAC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AM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AACD,qBAAa,SAAU,SAAQ,UAAU,CAAC,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC;IACvG,IAAI,MAAM,WAET;CACF;AACD,UAAU,eAAe;IACvB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AACD,qBAAa,UAAW,SAAQ,UAAU,CAAC,eAAe,GAAG,kBAAkB,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;CAAG;AAExG,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AACD,qBAAa,cAAe,SAAQ,UAAU,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;IAC/G,KAAK;IAIL,QAAQ;CAWT"}
@@ -48,27 +48,19 @@ export class LabelComp extends ComponentX {
48
48
  }
49
49
  export var ScrollViewDirection;
50
50
  (function (ScrollViewDirection) {
51
- ScrollViewDirection[ScrollViewDirection["NONE"] = cc.SCROLLVIEW_DIRECTION_NONE] = "NONE";
52
- ScrollViewDirection[ScrollViewDirection["HORIZONTAL"] = cc.SCROLLVIEW_DIRECTION_HORIZONTAL] = "HORIZONTAL";
53
- ScrollViewDirection[ScrollViewDirection["VERTICAL"] = cc.SCROLLVIEW_DIRECTION_VERTICAL] = "VERTICAL";
54
- ScrollViewDirection[ScrollViewDirection["BOTH"] = cc.SCROLLVIEW_DIRECTION_BOTH] = "BOTH";
51
+ ScrollViewDirection[ScrollViewDirection["NONE"] = ccui.ScrollView.DIR_NONE] = "NONE";
52
+ ScrollViewDirection[ScrollViewDirection["HORIZONTAL"] = ccui.ScrollView.DIR_HORIZONTAL] = "HORIZONTAL";
53
+ ScrollViewDirection[ScrollViewDirection["VERTICAL"] = ccui.ScrollView.DIR_VERTICAL] = "VERTICAL";
54
+ ScrollViewDirection[ScrollViewDirection["BOTH"] = ccui.ScrollView.DIR_BOTH] = "BOTH";
55
55
  })(ScrollViewDirection || (ScrollViewDirection = {}));
56
56
  export class ScrollViewComp extends ComponentX {
57
57
  zoom(scale) {
58
- if (this.node.instance instanceof cc.ScrollView) {
59
- this.node.instance.getContainer().setScale(scale);
58
+ if (this.node.instance instanceof ccui.ScrollView) {
59
+ ;
60
+ this.node.instance._innerContainer.setScale(scale);
60
61
  }
61
62
  }
62
63
  }
63
- export var ListViewDirection;
64
- (function (ListViewDirection) {
65
- ListViewDirection[ListViewDirection["NONE"] = ccui.ScrollView.DIR_NONE] = "NONE";
66
- ListViewDirection[ListViewDirection["HORIZONTAL"] = ccui.ScrollView.DIR_HORIZONTAL] = "HORIZONTAL";
67
- ListViewDirection[ListViewDirection["VERTICAL"] = ccui.ScrollView.DIR_VERTICAL] = "VERTICAL";
68
- ListViewDirection[ListViewDirection["BOTH"] = ccui.ScrollView.DIR_BOTH] = "BOTH";
69
- })(ListViewDirection || (ListViewDirection = {}));
70
- export class ListViewComp extends ComponentX {
71
- }
72
64
  export class InputComp extends ComponentX {
73
65
  get string() {
74
66
  return this.node.instance.getString();
@@ -95,6 +87,5 @@ export class GridLayoutComp extends ComponentX {
95
87
  Object.defineProperty(ProgressTimerComp.prototype, 'render', { value: render });
96
88
  Object.defineProperty(LabelComp.prototype, 'render', { value: render });
97
89
  Object.defineProperty(ScrollViewComp.prototype, 'render', { value: render });
98
- Object.defineProperty(ListViewComp.prototype, 'render', { value: render });
99
90
  Object.defineProperty(InputComp.prototype, 'render', { value: render });
100
91
  Object.defineProperty(ButtonComp.prototype, 'render', { value: render });
@@ -6,7 +6,6 @@ export declare class GUISystem implements System {
6
6
  private onAddProgressTimerComp;
7
7
  private onAddLabelComp;
8
8
  private onAddScrollViewComp;
9
- private onAddListViewComp;
10
9
  private onAddInputComp;
11
10
  private onAddWidgetComp;
12
11
  private onAddGridLayoutComp;
@@ -1 +1 @@
1
- {"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/gui/GUISystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoC,MAAM,EAAE,MAAM,YAAY,CAAA;AAenF,qBAAa,SAAU,YAAW,MAAM;IACtC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAA;IAC1B,SAAS,CAAC,aAAa,EAAE,YAAY;IAWrC,OAAO,CAAC,eAAe,CAuBtB;IAED,OAAO,CAAC,sBAAsB,CAc7B;IAED,OAAO,CAAC,cAAc,CAerB;IAED,OAAO,CAAC,mBAAmB,CAU1B;IAED,OAAO,CAAC,iBAAiB,CAUxB;IAED,OAAO,CAAC,cAAc,CAWrB;IAED,OAAO,CAAC,eAAe,CAetB;IAED,OAAO,CAAC,mBAAmB,CAG1B;CAKF"}
1
+ {"version":3,"file":"GUISystem.d.ts","sourceRoot":"","sources":["../../src/gui/GUISystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoC,MAAM,EAAE,MAAM,YAAY,CAAA;AAKnF,qBAAa,SAAU,YAAW,MAAM;IACtC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAA;IAC1B,SAAS,CAAC,aAAa,EAAE,YAAY;IAUrC,OAAO,CAAC,eAAe,CAuBtB;IAED,OAAO,CAAC,sBAAsB,CAc7B;IAED,OAAO,CAAC,cAAc,CAerB;IAED,OAAO,CAAC,mBAAmB,CAU1B;IAED,OAAO,CAAC,cAAc,CAWrB;IAED,OAAO,CAAC,eAAe,CAetB;IAED,OAAO,CAAC,mBAAmB,CAG1B;CAKF"}
@@ -1,7 +1,7 @@
1
1
  import { EventTypes } from 'entityx-ts';
2
2
  import { NodeComp } from '../core/NodeComp';
3
3
  import { Vec2 } from '../polyfills';
4
- import { ButtonComp, FillType, GridLayoutComp, InputComp, LabelComp, ListViewComp, ProgressTimerComp, ScrollViewComp, WidgetComp, } from './GUIComponent';
4
+ import { ButtonComp, FillType, GridLayoutComp, InputComp, LabelComp, ProgressTimerComp, ScrollViewComp, WidgetComp } from './GUIComponent';
5
5
  export class GUISystem {
6
6
  static defaultFont;
7
7
  configure(event_manager) {
@@ -9,7 +9,6 @@ export class GUISystem {
9
9
  event_manager.subscribe(EventTypes.ComponentAdded, ProgressTimerComp, this.onAddProgressTimerComp);
10
10
  event_manager.subscribe(EventTypes.ComponentAdded, LabelComp, this.onAddLabelComp);
11
11
  event_manager.subscribe(EventTypes.ComponentAdded, ScrollViewComp, this.onAddScrollViewComp);
12
- event_manager.subscribe(EventTypes.ComponentAdded, ListViewComp, this.onAddListViewComp);
13
12
  event_manager.subscribe(EventTypes.ComponentAdded, InputComp, this.onAddInputComp);
14
13
  event_manager.subscribe(EventTypes.ComponentAdded, WidgetComp, this.onAddWidgetComp);
15
14
  event_manager.subscribe(EventTypes.ComponentAdded, GridLayoutComp, this.onAddGridLayoutComp);
@@ -72,18 +71,6 @@ export class GUISystem {
72
71
  };
73
72
  onAddScrollViewComp = ({ entity, component: scrollView }) => {
74
73
  const { viewSize, contentSize, isScrollToTop, isBounced, direction = cc.SCROLLVIEW_DIRECTION_VERTICAL } = scrollView.props;
75
- const node = new cc.ScrollView(viewSize);
76
- node.setViewSize(viewSize);
77
- node.setContentSize(contentSize);
78
- node.setDirection(direction);
79
- if (isScrollToTop !== undefined)
80
- node.setContentOffset(cc.p(0, viewSize.height - contentSize.height));
81
- // node.setTouchEnabled(false)
82
- node.setBounceable(isBounced !== undefined);
83
- scrollView.node = entity.assign(new NodeComp(node, entity));
84
- };
85
- onAddListViewComp = ({ entity, component: listView }) => {
86
- const { viewSize, contentSize, isScrollToTop, isBounced, direction = ccui.ScrollView.DIR_VERTICAL } = listView.props;
87
74
  const node = new ccui.ScrollView();
88
75
  node.setContentSize(viewSize);
89
76
  node.setInnerContainerSize(contentSize);
@@ -92,7 +79,7 @@ export class GUISystem {
92
79
  node.scrollToTop(0, true);
93
80
  // node.setTouchEnabled(false)
94
81
  node.setBounceEnabled(isBounced !== undefined);
95
- listView.node = entity.assign(new NodeComp(node, entity));
82
+ scrollView.node = entity.assign(new NodeComp(node, entity));
96
83
  };
97
84
  onAddInputComp = ({ entity, component: textInput }) => {
98
85
  const { placeHolder = '', font = GUISystem.defaultFont, size = 64, maxLength = 20, isPassword = false } = textInput.props;
@@ -1,5 +1,6 @@
1
1
  export * from './action';
2
2
  export * from './director';
3
+ export * from './Intersection';
3
4
  export * from './math';
4
5
  export * from './utils';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helper/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helper/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export * from './action';
2
2
  export * from './director';
3
+ export * from './Intersection';
3
4
  export * from './math';
4
5
  export * from './utils';
@@ -0,0 +1,10 @@
1
+ import { Color4B, NodeComp } from '.';
2
+ export type ColorSource = ReturnType<typeof Color4B>;
3
+ export interface BaseComponentProps<T> {
4
+ $ref?: T;
5
+ $push?: T[];
6
+ $refNode?: NodeComp;
7
+ $pushNode?: NodeComp[];
8
+ node?: Partial<NodeComp>;
9
+ }
10
+ //# sourceMappingURL=safex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safex.d.ts","sourceRoot":"","sources":["../src/safex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAA;AAErC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAA;AAEpD,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CAEzB"}
package/dist/safex.js ADDED
@@ -0,0 +1,25 @@
1
+ export {};
2
+ // interface LoadingBarProps {}
3
+ // interface PhysicsMaterialProps {
4
+ // friction?: number
5
+ // restitution?: number
6
+ // density?: number
7
+ // }
8
+ // interface ColliderPhysicsProps {
9
+ // tag?: number
10
+ // group?: number
11
+ // offset?: Vec2
12
+ // onCollisionEnter?: (other: Collider) => void
13
+ // onCollisionExit?: (other: Collider) => void
14
+ // onCollisionStay?: (other: Collider) => void
15
+ // }
16
+ // interface BoxColliderPhysicsProps {
17
+ // width: number
18
+ // height: number
19
+ // }
20
+ // interface CircleColliderPhysicsProps {
21
+ // radius: number
22
+ // }
23
+ // interface PolygonColliderPhysicsProps {
24
+ // points: Array<Vec2>
25
+ // }
@@ -0,0 +1,189 @@
1
+ /****************************************************************************
2
+ Copyright (c) 2011-2012 cocos2d-x.org
3
+ Copyright (c) 2013-2014 Chukong Technologies Inc.
4
+ Copyright (c) 2014 Shengxiang Chen (Nero Chan)
5
+
6
+ http://www.cocos2d-x.org
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+ ****************************************************************************/
26
+ /**
27
+ * The main namespace of Spine, all classes, functions, properties and constants of Spine are defined in this namespace
28
+ * @namespace
29
+ * @name
30
+ */
31
+ /**
32
+ * <p>
33
+ * The skeleton of Spine. <br/>
34
+ * Skeleton has a reference to a SkeletonData and stores the state for skeleton instance,
35
+ * which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible. <br/>
36
+ * Multiple skeletons can use the same SkeletonData (which includes all animations, skins, and attachments). <br/>
37
+ * </p>
38
+ * @class
39
+ * @extends cc.Node
40
+ */
41
+ export declare class Skeleton extends cc.Node {
42
+ _skeleton: any;
43
+ _rootBone: any;
44
+ _timeScale: number;
45
+ _debugSlots: boolean;
46
+ _debugBones: boolean;
47
+ _premultipliedAlpha: any;
48
+ _ownsSkeletonData: any;
49
+ _atlas: any;
50
+ constructor(skeletonDataFile?: string, atlasFile?: string, scale?: number);
51
+ _createRenderCmd(): any;
52
+ onEnter(): void;
53
+ onExit(): void;
54
+ /**
55
+ * Sets whether open debug slots.
56
+ * @param {boolean} enable true to open, false to close.
57
+ */
58
+ setDebugSolots(enable: boolean): void;
59
+ /**
60
+ * Sets whether open debug bones.
61
+ * @param {boolean} enable
62
+ */
63
+ setDebugBones(enable: boolean): void;
64
+ /**
65
+ * Sets whether open debug slots.
66
+ * @param {boolean} enabled true to open, false to close.
67
+ */
68
+ setDebugSlotsEnabled(enabled: boolean): void;
69
+ /**
70
+ * Gets whether open debug slots.
71
+ * @returns {boolean} true to open, false to close.
72
+ */
73
+ getDebugSlotsEnabled(): boolean;
74
+ /**
75
+ * Sets whether open debug bones.
76
+ * @param {boolean} enabled
77
+ */
78
+ setDebugBonesEnabled(enabled: boolean): void;
79
+ /**
80
+ * Gets whether open debug bones.
81
+ * @returns {boolean} true to open, false to close.
82
+ */
83
+ getDebugBonesEnabled(): boolean;
84
+ /**
85
+ * Sets the time scale of Skeleton.
86
+ * @param {Number} scale
87
+ */
88
+ setTimeScale(scale: number): void;
89
+ getTimeScale(): number;
90
+ /**
91
+ * Initializes Skeleton with Data.
92
+ * @param {.spine.SkeletonData|String} skeletonDataFile
93
+ * @param {String|spine.Atlas|spine.SkeletonData} atlasFile atlas filename or atlas data or owns SkeletonData
94
+ * @param {Number} [scale] scale can be specified on the JSON or binary loader which will scale the bone positions, image sizes, and animation translations.
95
+ */
96
+ initWithArgs(skeletonDataFile: string, atlasFile: string, scale?: number): void;
97
+ /**
98
+ * Returns the bounding box of Skeleton.
99
+ * @returns {cc.Rect}
100
+ */
101
+ getBoundingBox(): cc.Rect;
102
+ /**
103
+ * Computes the world SRT from the local SRT for each bone.
104
+ */
105
+ updateWorldTransform(): void;
106
+ /**
107
+ * Sets the bones and slots to the setup pose.
108
+ */
109
+ setToSetupPose(): void;
110
+ /**
111
+ * Sets the bones to the setup pose, using the values from the `BoneData` list in the `SkeletonData`.
112
+ */
113
+ setBonesToSetupPose(): void;
114
+ /**
115
+ * Sets the slots to the setup pose, using the values from the `SlotData` list in the `SkeletonData`.
116
+ */
117
+ setSlotsToSetupPose(): void;
118
+ /**
119
+ * Finds a bone by name. This does a string comparison for every bone.
120
+ * @param {String} boneName
121
+ * @returns {.spine.Bone}
122
+ */
123
+ findBone(boneName: string): any;
124
+ /**
125
+ * Finds a slot by name. This does a string comparison for every slot.
126
+ * @param {String} slotName
127
+ * @returns {.spine.Slot}
128
+ */
129
+ findSlot(slotName: string): any;
130
+ /**
131
+ * 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.
132
+ * @param {string} skinName
133
+ * @returns {.spine.Skin}
134
+ */
135
+ setSkin(skinName: string): any;
136
+ /**
137
+ * Returns the attachment for the slot and attachment name. The skeleton looks first in its skin, then in the skeleton data’s default skin.
138
+ * @param {String} slotName
139
+ * @param {String} attachmentName
140
+ * @returns {.spine.Attachment}
141
+ */
142
+ getAttachment(slotName: string, attachmentName: string): any;
143
+ /**
144
+ * Sets the attachment for the slot and attachment name. The skeleton looks first in its skin, then in the skeleton data’s default skin.
145
+ * @param {String} slotName
146
+ * @param {String} attachmentName
147
+ */
148
+ setAttachment(slotName: string, attachmentName: string): void;
149
+ /**
150
+ * Sets the premultiplied alpha value to Skeleton.
151
+ * @param {Number} alpha
152
+ */
153
+ setPremultipliedAlpha(premultiplied: boolean): void;
154
+ /**
155
+ * Returns whether to enable premultiplied alpha.
156
+ * @returns {boolean}
157
+ */
158
+ isPremultipliedAlpha(): boolean;
159
+ /**
160
+ * Sets skeleton data to Skeleton.
161
+ * @param {.spine.SkeletonData} skeletonData
162
+ * @param {.spine.SkeletonData} ownsSkeletonData
163
+ */
164
+ setSkeletonData(skeletonData: any, ownsSkeletonData: any): void;
165
+ /**
166
+ * Return the renderer of attachment.
167
+ * @param {.spine.RegionAttachment|.spine.BoundingBoxAttachment} regionAttachment
168
+ * @returns {.spine.TextureAtlasRegion}
169
+ */
170
+ getTextureAtlas(regionAttachment: any): any;
171
+ /**
172
+ * Returns the blendFunc of Skeleton.
173
+ * @returns {cc.BlendFunc}
174
+ */
175
+ getBlendFunc(): any;
176
+ /**
177
+ * Sets the blendFunc of Skeleton, it won't have any effect for skeleton, skeleton is using slot's data to determine the blend function.
178
+ * @param {cc.BlendFunc|Number} src
179
+ * @param {Number} [dst]
180
+ */
181
+ setBlendFunc(src: any, dst?: any): any;
182
+ /**
183
+ * Update will be called automatically every frame if "scheduleUpdate" is called when the node is "live".
184
+ * @param {Number} dt Delta time since last update
185
+ */
186
+ update(dt: number): void;
187
+ static create(skeletonDataFile: string, atlasFile: string, scale?: number): Skeleton;
188
+ }
189
+ //# sourceMappingURL=CCSkeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CCSkeleton.d.ts","sourceRoot":"","sources":["../../src/spine/CCSkeleton.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;8EAwB8E;AAE9E;;;;GAIG;AACH;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,EAAE,CAAC,IAAI;IACnC,SAAS,MAAO;IAChB,SAAS,MAAO;IAChB,UAAU,SAAI;IACd,WAAW,UAAQ;IACnB,WAAW,UAAQ;IACnB,mBAAmB,MAAA;IACnB,iBAAiB,MAAO;IACxB,MAAM,MAAO;gBAED,gBAAgB,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAOzE,gBAAgB;IAKhB,OAAO;IAKP,MAAM;IAKN;;;OAGG;IACH,cAAc,CAAC,MAAM,EAAE,OAAO;IAI9B;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,OAAO;IAI7B;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO;IAIrC;;;OAGG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO;IAIrC;;;OAGG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;;OAGG;IACH,YAAY,CA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