@safe-engine/cocos 1.4.3 → 1.4.5
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.
- package/@types/index.d.ts +9 -2
- package/dist/app.d.ts +4 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +84 -0
- package/dist/gworld/components/NodeComp.d.ts.map +1 -1
- package/dist/gworld/systems/NoRenderSystem.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/dragonbones/cocos/CocosArmatureDisplay.d.ts +0 -77
- package/dist/dragonbones/cocos/CocosArmatureDisplay.d.ts.map +0 -1
- package/dist/dragonbones/cocos/CocosArmatureDisplay.js +0 -227
- package/dist/dragonbones/cocos/CocosFactory.d.ts +0 -128
- package/dist/dragonbones/cocos/CocosFactory.d.ts.map +0 -1
- package/dist/dragonbones/cocos/CocosFactory.js +0 -231
- package/dist/dragonbones/cocos/CocosSlot.d.ts +0 -49
- package/dist/dragonbones/cocos/CocosSlot.d.ts.map +0 -1
- package/dist/dragonbones/cocos/CocosSlot.js +0 -385
- package/dist/dragonbones/cocos/CocosTextureAtlasData.d.ts +0 -53
- package/dist/dragonbones/cocos/CocosTextureAtlasData.d.ts.map +0 -1
- package/dist/dragonbones/cocos/CocosTextureAtlasData.js +0 -158
- package/dist/dragonbones/dragonBones.d.ts +0 -3
- package/dist/dragonbones/dragonBones.d.ts.map +0 -1
- package/dist/dragonbones/dragonBones.js +0 -4788
- package/dist/helper/NodePool.d.ts +0 -9
- package/dist/helper/NodePool.d.ts.map +0 -1
- package/dist/helper/NodePool.js +0 -29
package/@types/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
type Float = number
|
|
2
2
|
type Integer = number
|
|
3
|
-
declare
|
|
4
|
-
declare
|
|
3
|
+
declare let dragonBones: any
|
|
4
|
+
declare let PIXI: any
|
|
5
5
|
|
|
6
6
|
declare namespace cc {
|
|
7
|
+
interface RunOptions {
|
|
8
|
+
debugMode: 1 | 0
|
|
9
|
+
showFPS: boolean
|
|
10
|
+
frameRate: number
|
|
11
|
+
id: string
|
|
12
|
+
renderMode: 0 | 1 | 2
|
|
13
|
+
}
|
|
7
14
|
declare let v2: (x?: number | any, y?: number) => Vec2
|
|
8
15
|
declare let v3: (x?: number | any, y?: number, z?: number) => Vec3
|
|
9
16
|
declare let instantiate: (id: string) => NodeComp
|
package/dist/app.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export declare function initWorld(): void;
|
|
2
|
+
export declare function startGame(option: cc.RunOptions, designedResolution: any, cb: any): void;
|
|
3
|
+
export declare function loadAll(assets: string[], cb: (progress: number) => void): void;
|
|
4
|
+
export declare function loadJsonFromCache<T>(filePath: string): T;
|
|
5
|
+
export declare const audioEngine: typeof cc.audioEngine;
|
|
2
6
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAOA,wBAAgB,SAAS,SAcxB"}
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAOA,wBAAgB,SAAS,SAcxB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,EAAE,kBAAkB,KAAA,EAAE,EAAE,KAAA,QAgCtE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAO,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,QA4B5E;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,CAIxD;AAED,eAAO,MAAM,WAAW,uBAAiB,CAAA"}
|
package/dist/app.js
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.audioEngine = void 0;
|
|
3
19
|
exports.initWorld = initWorld;
|
|
20
|
+
exports.startGame = startGame;
|
|
21
|
+
exports.loadAll = loadAll;
|
|
22
|
+
exports.loadJsonFromCache = loadJsonFromCache;
|
|
4
23
|
var dragonbones_1 = require("./dragonbones");
|
|
5
24
|
var gworld_1 = require("./gworld");
|
|
6
25
|
var CollideSystem_1 = require("./gworld/systems/CollideSystem");
|
|
@@ -22,3 +41,68 @@ function initWorld() {
|
|
|
22
41
|
gworld_1.GameWorld.Instance.systems.configureOnce(NoRenderSystem_1.NoRenderSystem);
|
|
23
42
|
(0, dragonbones_1.setupDragonBones)();
|
|
24
43
|
}
|
|
44
|
+
function startGame(option, designedResolution, cb) {
|
|
45
|
+
var width = designedResolution.width, height = designedResolution.height;
|
|
46
|
+
var BootScene = /** @class */ (function (_super) {
|
|
47
|
+
__extends(BootScene, _super);
|
|
48
|
+
function BootScene() {
|
|
49
|
+
// 1. super init first
|
|
50
|
+
var _this = _super.call(this) || this;
|
|
51
|
+
_super.prototype.ctor.call(_this); // always call this for compatibility with cocos2dx JS Javascript class system
|
|
52
|
+
_this.scheduleUpdate();
|
|
53
|
+
return _this;
|
|
54
|
+
}
|
|
55
|
+
BootScene.prototype.onEnter = function () {
|
|
56
|
+
_super.prototype.onEnter.call(this);
|
|
57
|
+
cb();
|
|
58
|
+
};
|
|
59
|
+
BootScene.prototype.update = function (dt) {
|
|
60
|
+
gworld_1.GameWorld.Instance.update(dt);
|
|
61
|
+
};
|
|
62
|
+
return BootScene;
|
|
63
|
+
}(cc.Scene));
|
|
64
|
+
cc._isContextMenuEnable = true;
|
|
65
|
+
cc.game.run(option, function onStart() {
|
|
66
|
+
// Pass true to enable retina display, disabled by default to improve performance
|
|
67
|
+
cc.view.enableRetina(cc.sys.os === cc.sys.OS_IOS);
|
|
68
|
+
// Adjust viewport meta
|
|
69
|
+
cc.view.adjustViewPort(true);
|
|
70
|
+
// Setup the resolution policy and design resolution size
|
|
71
|
+
cc.view.setDesignResolutionSize(width, height, cc.ResolutionPolicy.FIXED_WIDTH);
|
|
72
|
+
// The game will be resized when browser size change
|
|
73
|
+
cc.view.resizeWithBrowserSize(true);
|
|
74
|
+
cc.director.runScene(new BootScene());
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function loadAll(assets, cb) {
|
|
78
|
+
if (assets === void 0) { assets = []; }
|
|
79
|
+
cc.loader.load(assets.map(function (value) {
|
|
80
|
+
if (value.endsWith('.ttf')) {
|
|
81
|
+
return {
|
|
82
|
+
type: 'font',
|
|
83
|
+
name: cc.path.basename(value, '.ttf'),
|
|
84
|
+
srcs: [value],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return value;
|
|
88
|
+
}), function (result, count, loadedCount) {
|
|
89
|
+
// console.log(result)
|
|
90
|
+
if (result instanceof cc.Texture2D) {
|
|
91
|
+
// cc.textureCache.addImage(result.url)
|
|
92
|
+
var frame = new cc.SpriteFrame(result.url, cc.rect(0, 0, result.getPixelsWide(), result.getPixelsHigh()));
|
|
93
|
+
// console.log('cc.Texture2D', result, frame)
|
|
94
|
+
cc.spriteFrameCache.addSpriteFrame(frame, result.url);
|
|
95
|
+
}
|
|
96
|
+
var percent = loadedCount / count;
|
|
97
|
+
percent = Math.min(percent, 1);
|
|
98
|
+
cb(percent);
|
|
99
|
+
}, function () {
|
|
100
|
+
setTimeout(cb, 500, 1);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function loadJsonFromCache(filePath) {
|
|
104
|
+
var res = cc.loader.getRes(filePath);
|
|
105
|
+
// console.log(filePath, res)
|
|
106
|
+
return res;
|
|
107
|
+
}
|
|
108
|
+
exports.audioEngine = cc.audioEngine;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeComp.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/NodeComp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,OAAA,KAAK,IAAI,CAAA;AACjD,qBAAa,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,CAAA;IACX,MAAM,EAAE,QAAQ,CAAA;IAChB,QAAQ,EAAE,QAAQ,EAAE,CAAK;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,MAAA;IACN,OAAO,UAAO;gBAEF,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM;IAKvC,IAAI,IAAI,WAEP;IAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,CAE7B;IAED,IAAI,QAAQ,CAAC,GAAG,EAAE,IAAI,EAErB;IAED,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAExB;IAED,I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AY,CAAA;AAM5E,qBAAa,cAAe,YAAW,MAAM;IAC3C,SAAS,CAAC,aAAa,EAAE,YAAY;IAMrC,uBAAuB;;;
|
|
1
|
+
{"version":3,"file":"NoRenderSystem.d.ts","sourceRoot":"","sources":["../../../src/gworld/systems/NoRenderSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;AAM5E,qBAAa,cAAe,YAAW,MAAM;IAC3C,SAAS,CAAC,aAAa,EAAE,YAAY;IAMrC,uBAAuB,GAAI;;;KAAqB,UAiD/C;IAED,kBAAkB,GAAI;;KAAc,UAInC;IAED,2BAA2B,GAAI;;KAAa,UAM3C;IAED,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;CAIjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@safe-engine/cocos",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "safe-engine with cocos renderer support",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build": "tsc"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"cocos-html5-ts": "^1.1.
|
|
20
|
+
"cocos-html5-ts": "^1.1.10",
|
|
21
21
|
"typescript": "^5.7.3"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The MIT License (MIT)
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2012-2018 DragonBones team and other contributors
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
7
|
-
* this software and associated documentation files (the "Software"), to deal in
|
|
8
|
-
* the Software without restriction, including without limitation the rights to
|
|
9
|
-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
10
|
-
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
18
|
-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
19
|
-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
20
|
-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
21
|
-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
import { Armature, EventObject, EventStringType, IArmatureProxy } from '@cocos/dragonbones-js';
|
|
24
|
-
export declare class CocosArmatureDisplay extends cc.Sprite implements IArmatureProxy {
|
|
25
|
-
/**
|
|
26
|
-
* @private
|
|
27
|
-
*/
|
|
28
|
-
debugDraw: boolean;
|
|
29
|
-
private _debugDraw;
|
|
30
|
-
private _armature;
|
|
31
|
-
private _debugDrawer;
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
dbInit(armature: Armature): void;
|
|
36
|
-
/**
|
|
37
|
-
* @inheritDoc
|
|
38
|
-
*/
|
|
39
|
-
dbClear(): void;
|
|
40
|
-
/**
|
|
41
|
-
* @inheritDoc
|
|
42
|
-
*/
|
|
43
|
-
dbUpdate(): void;
|
|
44
|
-
/**
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
dispose(disposeProxy?: boolean): void;
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
destroy(): void;
|
|
52
|
-
/**
|
|
53
|
-
* @private
|
|
54
|
-
*/
|
|
55
|
-
dispatchDBEvent(type: EventStringType, eventObject: EventObject): void;
|
|
56
|
-
/**
|
|
57
|
-
* @inheritDoc
|
|
58
|
-
*/
|
|
59
|
-
hasDBEventListener(type: EventStringType): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* @inheritDoc
|
|
62
|
-
*/
|
|
63
|
-
addDBEventListener(type: EventStringType, listener: (event: EventObject) => void, target: any): void;
|
|
64
|
-
/**
|
|
65
|
-
* @inheritDoc
|
|
66
|
-
*/
|
|
67
|
-
removeDBEventListener(type: EventStringType, listener: (event: EventObject) => void, target: any): void;
|
|
68
|
-
/**
|
|
69
|
-
* @inheritDoc
|
|
70
|
-
*/
|
|
71
|
-
get armature(): Armature;
|
|
72
|
-
/**
|
|
73
|
-
* @inheritDoc
|
|
74
|
-
*/
|
|
75
|
-
get animation(): Animation;
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=CocosArmatureDisplay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CocosArmatureDisplay.d.ts","sourceRoot":"","sources":["../../../src/dragonbones/cocos/CocosArmatureDisplay.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,QAAQ,EAAgC,WAAW,EAAE,eAAe,EAAE,cAAc,EAA0B,MAAM,uBAAuB,CAAC;AAErJ,qBAAa,oBAAqB,SAAQ,EAAE,CAAC,MAAO,YAAW,cAAc;IAC3E;;OAEG;IACI,SAAS,UAAS;IACzB,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,YAAY,CAA0B;IAC9C;;OAEG;IACI,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAGvC;;OAEG;IACI,OAAO,IAAI,IAAI;IAUtB;;OAEG;IACI,QAAQ,IAAI,IAAI;IAyGvB;;OAEG;IACI,OAAO,CAAC,YAAY,UAAO,GAAG,IAAI;IAQzC;;OAEG;IACI,OAAO,IAAI,IAAI;IAGtB;;OAEG;IACI,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI;IAG7E;;OAEG;IACI,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO;IAIzD;;OAEG;IACI,kBAAkB,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI;IAG3G;;OAEG;IACI,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI;IAG9G;;OAEG;IACH,IAAW,QAAQ,IAAI,QAAQ,CAE9B;IACD;;OAEG;IACH,IAAW,SAAS,IAAI,SAAS,CAEhC;CACF"}
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
/**
|
|
4
|
-
* The MIT License (MIT)
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012-2018 DragonBones team and other contributors
|
|
7
|
-
*
|
|
8
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
9
|
-
* this software and associated documentation files (the "Software"), to deal in
|
|
10
|
-
* the Software without restriction, including without limitation the rights to
|
|
11
|
-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
12
|
-
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
-
* subject to the following conditions:
|
|
14
|
-
*
|
|
15
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
-
* 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, FITNESS
|
|
20
|
-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
21
|
-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
22
|
-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
23
|
-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
-
*/
|
|
25
|
-
var __extends = (this && this.__extends) || (function () {
|
|
26
|
-
var extendStatics = function (d, b) {
|
|
27
|
-
extendStatics = Object.setPrototypeOf ||
|
|
28
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
29
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
30
|
-
return extendStatics(d, b);
|
|
31
|
-
};
|
|
32
|
-
return function (d, b) {
|
|
33
|
-
if (typeof b !== "function" && b !== null)
|
|
34
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
35
|
-
extendStatics(d, b);
|
|
36
|
-
function __() { this.constructor = d; }
|
|
37
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.CocosArmatureDisplay = void 0;
|
|
42
|
-
var dragonbones_js_1 = require("@cocos/dragonbones-js");
|
|
43
|
-
var CocosArmatureDisplay = /** @class */ (function (_super) {
|
|
44
|
-
__extends(CocosArmatureDisplay, _super);
|
|
45
|
-
function CocosArmatureDisplay() {
|
|
46
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
47
|
-
/**
|
|
48
|
-
* @private
|
|
49
|
-
*/
|
|
50
|
-
_this.debugDraw = false;
|
|
51
|
-
_this._debugDraw = false;
|
|
52
|
-
// private _disposeProxy: boolean = false;
|
|
53
|
-
_this._armature = null;
|
|
54
|
-
_this._debugDrawer = null;
|
|
55
|
-
return _this;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* @inheritDoc
|
|
59
|
-
*/
|
|
60
|
-
CocosArmatureDisplay.prototype.dbInit = function (armature) {
|
|
61
|
-
this._armature = armature;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* @inheritDoc
|
|
65
|
-
*/
|
|
66
|
-
CocosArmatureDisplay.prototype.dbClear = function () {
|
|
67
|
-
if (this._debugDrawer !== null) {
|
|
68
|
-
this._debugDrawer.removeFromParent();
|
|
69
|
-
}
|
|
70
|
-
this._armature = null;
|
|
71
|
-
this._debugDrawer = null;
|
|
72
|
-
_super.prototype.removeFromParent.call(this);
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* @inheritDoc
|
|
76
|
-
*/
|
|
77
|
-
CocosArmatureDisplay.prototype.dbUpdate = function () {
|
|
78
|
-
var drawed = dragonbones_js_1.DragonBones.debugDraw || this.debugDraw;
|
|
79
|
-
if (drawed || this._debugDraw) {
|
|
80
|
-
this._debugDraw = drawed;
|
|
81
|
-
if (this._debugDraw) {
|
|
82
|
-
if (this._debugDrawer === null) {
|
|
83
|
-
this._debugDrawer = new cc.Sprite();
|
|
84
|
-
var boneDrawer_1 = new cc.DrawNode();
|
|
85
|
-
this._debugDrawer.addChild(boneDrawer_1);
|
|
86
|
-
}
|
|
87
|
-
this.addChild(this._debugDrawer);
|
|
88
|
-
var boneDrawer = this._debugDrawer.children[0];
|
|
89
|
-
boneDrawer.clear();
|
|
90
|
-
var bones = this._armature.getBones();
|
|
91
|
-
for (var i = 0, l = bones.length; i < l; ++i) {
|
|
92
|
-
var bone = bones[i];
|
|
93
|
-
var boneLength = bone.boneData.length;
|
|
94
|
-
var startX = bone.globalTransformMatrix.tx;
|
|
95
|
-
var startY = bone.globalTransformMatrix.ty;
|
|
96
|
-
var endX = startX + bone.globalTransformMatrix.a * boneLength;
|
|
97
|
-
var endY = startY + bone.globalTransformMatrix.b * boneLength;
|
|
98
|
-
boneDrawer.setLineWidth(2.0);
|
|
99
|
-
boneDrawer.setColor(cc.color('0x00FFFF'));
|
|
100
|
-
boneDrawer.drawSegment(cc.p(startX, startY), cc.p(endX, endY));
|
|
101
|
-
// boneDrawer.lineStyle(0.0, 0, 0.0);
|
|
102
|
-
// boneDrawer.beginFill(0x00FFFF, 0.7);
|
|
103
|
-
boneDrawer.drawCircle(cc.p(startX, startY), 3.0, Math.PI * 2, 64);
|
|
104
|
-
// boneDrawer.endFill();
|
|
105
|
-
}
|
|
106
|
-
var slots = this._armature.getSlots();
|
|
107
|
-
for (var i = 0, l = slots.length; i < l; ++i) {
|
|
108
|
-
var slot = slots[i];
|
|
109
|
-
var boundingBoxData = slot.boundingBoxData;
|
|
110
|
-
if (boundingBoxData) {
|
|
111
|
-
var child = this._debugDrawer.getChildByName(slot.name);
|
|
112
|
-
if (!child) {
|
|
113
|
-
child = new cc.DrawNode();
|
|
114
|
-
child.name = slot.name;
|
|
115
|
-
this._debugDrawer.addChild(child);
|
|
116
|
-
}
|
|
117
|
-
child.clear();
|
|
118
|
-
child.lineStyle(2.0, 0xFF00FF, 0.7);
|
|
119
|
-
switch (boundingBoxData.type) {
|
|
120
|
-
case dragonbones_js_1.BoundingBoxType.Rectangle:
|
|
121
|
-
child.drawRect(-boundingBoxData.width * 0.5, -boundingBoxData.height * 0.5, boundingBoxData.width, boundingBoxData.height);
|
|
122
|
-
break;
|
|
123
|
-
case dragonbones_js_1.BoundingBoxType.Ellipse:
|
|
124
|
-
child.drawEllipse(-boundingBoxData.width * 0.5, -boundingBoxData.height * 0.5, boundingBoxData.width, boundingBoxData.height);
|
|
125
|
-
break;
|
|
126
|
-
case dragonbones_js_1.BoundingBoxType.Polygon:
|
|
127
|
-
var vertices = boundingBoxData.vertices;
|
|
128
|
-
for (var i_1 = 0, l_1 = vertices.length; i_1 < l_1; i_1 += 2) {
|
|
129
|
-
var x = vertices[i_1];
|
|
130
|
-
var y = vertices[i_1 + 1];
|
|
131
|
-
if (i_1 === 0) {
|
|
132
|
-
child.moveTo(x, y);
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
child.lineTo(x, y);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
child.lineTo(vertices[0], vertices[1]);
|
|
139
|
-
break;
|
|
140
|
-
default:
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
child.endFill();
|
|
144
|
-
slot.updateTransformAndMatrix();
|
|
145
|
-
slot.updateGlobalTransform();
|
|
146
|
-
var transform = slot.global;
|
|
147
|
-
child.setTransform(transform.x, transform.y, transform.scaleX, transform.scaleY, transform.rotation, transform.skew, 0.0, slot._pivotX, slot._pivotY);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
var child = this._debugDrawer.getChildByName(slot.name);
|
|
151
|
-
if (child) {
|
|
152
|
-
this._debugDrawer.removeChild(child);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
else if (this._debugDrawer !== null && this._debugDrawer.parent === this) {
|
|
158
|
-
this.removeChild(this._debugDrawer);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* @inheritDoc
|
|
164
|
-
*/
|
|
165
|
-
CocosArmatureDisplay.prototype.dispose = function (disposeProxy) {
|
|
166
|
-
if (disposeProxy === void 0) { disposeProxy = true; }
|
|
167
|
-
// tslint:disable-next-line:no-unused-expression
|
|
168
|
-
disposeProxy;
|
|
169
|
-
if (this._armature !== null) {
|
|
170
|
-
this._armature.dispose();
|
|
171
|
-
this._armature = null;
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* @inheritDoc
|
|
176
|
-
*/
|
|
177
|
-
CocosArmatureDisplay.prototype.destroy = function () {
|
|
178
|
-
this.dispose();
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* @private
|
|
182
|
-
*/
|
|
183
|
-
CocosArmatureDisplay.prototype.dispatchDBEvent = function (type, eventObject) {
|
|
184
|
-
this.emit(type, eventObject);
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* @inheritDoc
|
|
188
|
-
*/
|
|
189
|
-
CocosArmatureDisplay.prototype.hasDBEventListener = function (type) {
|
|
190
|
-
// return this.listenerCount(type) > 0;
|
|
191
|
-
return false;
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* @inheritDoc
|
|
195
|
-
*/
|
|
196
|
-
CocosArmatureDisplay.prototype.addDBEventListener = function (type, listener, target) {
|
|
197
|
-
this.addListener(type, listener, target);
|
|
198
|
-
};
|
|
199
|
-
/**
|
|
200
|
-
* @inheritDoc
|
|
201
|
-
*/
|
|
202
|
-
CocosArmatureDisplay.prototype.removeDBEventListener = function (type, listener, target) {
|
|
203
|
-
this.removeListener(type, listener, target);
|
|
204
|
-
};
|
|
205
|
-
Object.defineProperty(CocosArmatureDisplay.prototype, "armature", {
|
|
206
|
-
/**
|
|
207
|
-
* @inheritDoc
|
|
208
|
-
*/
|
|
209
|
-
get: function () {
|
|
210
|
-
return this._armature;
|
|
211
|
-
},
|
|
212
|
-
enumerable: false,
|
|
213
|
-
configurable: true
|
|
214
|
-
});
|
|
215
|
-
Object.defineProperty(CocosArmatureDisplay.prototype, "animation", {
|
|
216
|
-
/**
|
|
217
|
-
* @inheritDoc
|
|
218
|
-
*/
|
|
219
|
-
get: function () {
|
|
220
|
-
return this._armature.animation;
|
|
221
|
-
},
|
|
222
|
-
enumerable: false,
|
|
223
|
-
configurable: true
|
|
224
|
-
});
|
|
225
|
-
return CocosArmatureDisplay;
|
|
226
|
-
}(cc.Sprite));
|
|
227
|
-
exports.CocosArmatureDisplay = CocosArmatureDisplay;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The MIT License (MIT)
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2012-2018 DragonBones team and other contributors
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
7
|
-
* this software and associated documentation files (the "Software"), to deal in
|
|
8
|
-
* the Software without restriction, including without limitation the rights to
|
|
9
|
-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
10
|
-
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
18
|
-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
19
|
-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
20
|
-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
21
|
-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
import { Armature, BaseFactory, BuildArmaturePackage, DataParser, Slot, SlotData } from '@cocos/dragonbones-js';
|
|
24
|
-
import { CocosArmatureDisplay } from './CocosArmatureDisplay';
|
|
25
|
-
import { CocosTextureAtlasData } from './CocosTextureAtlasData';
|
|
26
|
-
/**
|
|
27
|
-
* - The PixiJS factory.
|
|
28
|
-
* @version DragonBones 3.0
|
|
29
|
-
* @language en_US
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* - PixiJS 工厂。
|
|
33
|
-
* @version DragonBones 3.0
|
|
34
|
-
* @language zh_CN
|
|
35
|
-
*/
|
|
36
|
-
export declare class CocosFactory extends BaseFactory {
|
|
37
|
-
private static _dragonBonesInstance;
|
|
38
|
-
private static _factory;
|
|
39
|
-
private static _clockHandler;
|
|
40
|
-
static advanceTime(passedTime: number): void;
|
|
41
|
-
static useSharedTicker: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* - A global factory instance that can be used directly.
|
|
44
|
-
* @version DragonBones 4.7
|
|
45
|
-
* @language en_US
|
|
46
|
-
*/
|
|
47
|
-
/**
|
|
48
|
-
* - 一个可以直接使用的全局工厂实例。
|
|
49
|
-
* @version DragonBones 4.7
|
|
50
|
-
* @language zh_CN
|
|
51
|
-
*/
|
|
52
|
-
static get factory(): CocosFactory;
|
|
53
|
-
/**
|
|
54
|
-
* - 一个获取全局工厂实例(单例)的方法, 和get factory相比, 优点是可以传参数。
|
|
55
|
-
* @version DragonBones 4.7
|
|
56
|
-
* @language zh_CN
|
|
57
|
-
*/
|
|
58
|
-
static newInstance(useSharedTicker?: boolean): CocosFactory;
|
|
59
|
-
/**
|
|
60
|
-
* @inheritDoc
|
|
61
|
-
*/
|
|
62
|
-
constructor(dataParser?: DataParser | null, useSharedTicker?: boolean);
|
|
63
|
-
protected _buildTextureAtlasData(textureAtlasData: CocosTextureAtlasData | null, textureAtlas: cc.Texture2D | null): CocosTextureAtlasData;
|
|
64
|
-
protected _buildArmature(dataPackage: BuildArmaturePackage): Armature;
|
|
65
|
-
protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
|
|
66
|
-
/**
|
|
67
|
-
* - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it.
|
|
68
|
-
* The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update.
|
|
69
|
-
* @param armatureName - The armature data name.
|
|
70
|
-
* @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)
|
|
71
|
-
* @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)
|
|
72
|
-
* @returns The armature display container.
|
|
73
|
-
* @see dragonBones.IArmatureProxy
|
|
74
|
-
* @see dragonBones.BaseFactory#buildArmature
|
|
75
|
-
* @version DragonBones 4.5
|
|
76
|
-
* @example
|
|
77
|
-
* <pre>
|
|
78
|
-
* let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
|
|
79
|
-
* </pre>
|
|
80
|
-
* @language en_US
|
|
81
|
-
*/
|
|
82
|
-
/**
|
|
83
|
-
* - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架,并用 {@link #clock} 更新该骨架。
|
|
84
|
-
* 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。
|
|
85
|
-
* @param armatureName - 骨架数据名称。
|
|
86
|
-
* @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架)
|
|
87
|
-
* @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据)
|
|
88
|
-
* @returns 骨架的显示容器。
|
|
89
|
-
* @see dragonBones.IArmatureProxy
|
|
90
|
-
* @see dragonBones.BaseFactory#buildArmature
|
|
91
|
-
* @version DragonBones 4.5
|
|
92
|
-
* @example
|
|
93
|
-
* <pre>
|
|
94
|
-
* let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
|
|
95
|
-
* </pre>
|
|
96
|
-
* @language zh_CN
|
|
97
|
-
*/
|
|
98
|
-
buildArmatureDisplay(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): CocosArmatureDisplay | null;
|
|
99
|
-
/**
|
|
100
|
-
* - Create the display object with the specified texture.
|
|
101
|
-
* @param textureName - The texture data name.
|
|
102
|
-
* @param textureAtlasName - The texture atlas data name (Of not set, all texture atlas data will be searched)
|
|
103
|
-
* @version DragonBones 3.0
|
|
104
|
-
* @language en_US
|
|
105
|
-
*/
|
|
106
|
-
/**
|
|
107
|
-
* - 创建带有指定贴图的显示对象。
|
|
108
|
-
* @param textureName - 贴图数据名称。
|
|
109
|
-
* @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据)
|
|
110
|
-
* @version DragonBones 3.0
|
|
111
|
-
* @language zh_CN
|
|
112
|
-
*/
|
|
113
|
-
getTextureDisplay(textureName: string, textureAtlasName?: string | null): cc.Sprite | null;
|
|
114
|
-
/**
|
|
115
|
-
* - A global sound event manager.
|
|
116
|
-
* Sound events can be listened to uniformly from the manager.
|
|
117
|
-
* @version DragonBones 4.5
|
|
118
|
-
* @language en_US
|
|
119
|
-
*/
|
|
120
|
-
/**
|
|
121
|
-
* - 全局声音事件管理器。
|
|
122
|
-
* 声音事件可以从该管理器统一侦听。
|
|
123
|
-
* @version DragonBones 4.5
|
|
124
|
-
* @language zh_CN
|
|
125
|
-
*/
|
|
126
|
-
get soundEventManager(): CocosArmatureDisplay;
|
|
127
|
-
}
|
|
128
|
-
//# sourceMappingURL=CocosFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CocosFactory.d.ts","sourceRoot":"","sources":["../../../src/dragonbones/cocos/CocosFactory.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAc,oBAAoB,EAAE,UAAU,EAAe,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,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