@safe-engine/cocos 1.4.3 → 1.4.6

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.
@@ -1,53 +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 { TextureAtlasData, TextureData } from '@cocos/dragonbones-js';
24
- export declare class CocosTextureAtlasData extends TextureAtlasData {
25
- static toString(): string;
26
- private _renderTexture;
27
- protected _onClear(): void;
28
- /**
29
- * @inheritDoc
30
- */
31
- createTexture(): TextureData;
32
- /**
33
- * - The CocosJS texture.
34
- * @version DragonBones 3.0
35
- * @language en_US
36
- */
37
- /**
38
- * - CocosJS 贴图。
39
- * @version DragonBones 3.0
40
- * @language zh_CN
41
- */
42
- get renderTexture(): cc.Texture2D | null;
43
- set renderTexture(value: cc.Texture2D | null);
44
- }
45
- /**
46
- * @internal
47
- */
48
- export declare class CocosTextureData extends TextureData {
49
- static toString(): string;
50
- renderTexture: cc.SpriteFrame | null;
51
- protected _onClear(): void;
52
- }
53
- //# sourceMappingURL=CocosTextureAtlasData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CocosTextureAtlasData.d.ts","sourceRoot":"","sources":["../../../src/dragonbones/cocos/CocosTextureAtlasData.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAc,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAElF,qBAAa,qBAAsB,SAAQ,gBAAgB;WAC3C,QAAQ,IAAI,MAAM;IAIhC,OAAO,CAAC,cAAc,CAA6B;IAEnD,SAAS,CAAC,QAAQ,IAAI,IAAI;IAS1B;;OAEG;IACI,aAAa,IAAI,WAAW;IAGnC;;;;OAIG;IACH;;;;OAIG;IACH,IAAW,aAAa,IAAI,EAAE,CAAC,SAAS,GAAG,IAAI,CAE9C;IACD,IAAW,aAAa,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,GAAG,IAAI,EAsDlD;CACF;AACD;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;WACjC,QAAQ,IAAI,MAAM;IAIzB,aAAa,EAAE,EAAE,CAAC,WAAW,GAAG,IAAI,CAAQ;IAEnD,SAAS,CAAC,QAAQ,IAAI,IAAI;CAS3B"}
@@ -1,158 +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.CocosTextureData = exports.CocosTextureAtlasData = void 0;
42
- var dragonbones_js_1 = require("@cocos/dragonbones-js");
43
- var CocosTextureAtlasData = /** @class */ (function (_super) {
44
- __extends(CocosTextureAtlasData, _super);
45
- function CocosTextureAtlasData() {
46
- var _this = _super !== null && _super.apply(this, arguments) || this;
47
- _this._renderTexture = null; // Initial value.
48
- return _this;
49
- }
50
- CocosTextureAtlasData.toString = function () {
51
- return '[class dragonBones.CocosTextureAtlasData]';
52
- };
53
- CocosTextureAtlasData.prototype._onClear = function () {
54
- _super.prototype._onClear.call(this);
55
- if (this._renderTexture !== null) {
56
- // this._renderTexture.dispose();
57
- }
58
- this._renderTexture = null;
59
- };
60
- /**
61
- * @inheritDoc
62
- */
63
- CocosTextureAtlasData.prototype.createTexture = function () {
64
- return dragonbones_js_1.BaseObject.borrowObject(CocosTextureData);
65
- };
66
- Object.defineProperty(CocosTextureAtlasData.prototype, "renderTexture", {
67
- /**
68
- * - The CocosJS texture.
69
- * @version DragonBones 3.0
70
- * @language en_US
71
- */
72
- /**
73
- * - CocosJS 贴图。
74
- * @version DragonBones 3.0
75
- * @language zh_CN
76
- */
77
- get: function () {
78
- return this._renderTexture;
79
- },
80
- set: function (value) {
81
- if (this._renderTexture === value) {
82
- return;
83
- }
84
- this._renderTexture = value;
85
- if (this._renderTexture !== null) {
86
- for (var k in this.textures) {
87
- var textureData = this.textures[k];
88
- if (textureData.renderTexture !== null) {
89
- textureData.renderTexture.destroy();
90
- }
91
- // console.log('textureData', this._renderTexture, textureData)
92
- // console.log('this._renderTexture', this._renderTexture)
93
- var x = textureData.region.x;
94
- var y = textureData.region.y;
95
- var rotated = textureData.rotated;
96
- var width = rotated ? textureData.region.height : textureData.region.width;
97
- var height = rotated ? textureData.region.width : textureData.region.height;
98
- var rect = cc.rect(x, y, width, height);
99
- var offset = cc.p(0, 0);
100
- var originSize = cc.size(width, height);
101
- if (textureData.frame) {
102
- var px = -textureData.frame.x;
103
- var py = -textureData.frame.y;
104
- originSize.width = textureData.frame.width;
105
- originSize.height = textureData.frame.height;
106
- // offset = sprite center - trimed texture center
107
- var cx1 = px + rect.width / 2;
108
- var cy1 = originSize.height - py - rect.height / 2;
109
- var cx2 = originSize.width / 2;
110
- var cy2 = originSize.height / 2;
111
- offset.x = cx2 - cx1;
112
- offset.y = cy2 - cy1;
113
- }
114
- // sprite
115
- var spriteFrame = new cc.SpriteFrame(this._renderTexture, rect, textureData.rotated, offset, originSize);
116
- // console.log('sf', sf)
117
- textureData.renderTexture = spriteFrame;
118
- }
119
- }
120
- else {
121
- for (var k in this.textures) {
122
- var textureData = this.textures[k];
123
- if (textureData.renderTexture !== null) {
124
- textureData.renderTexture.destroy();
125
- }
126
- textureData.renderTexture = null;
127
- }
128
- }
129
- },
130
- enumerable: false,
131
- configurable: true
132
- });
133
- return CocosTextureAtlasData;
134
- }(dragonbones_js_1.TextureAtlasData));
135
- exports.CocosTextureAtlasData = CocosTextureAtlasData;
136
- /**
137
- * @internal
138
- */
139
- var CocosTextureData = /** @class */ (function (_super) {
140
- __extends(CocosTextureData, _super);
141
- function CocosTextureData() {
142
- var _this = _super !== null && _super.apply(this, arguments) || this;
143
- _this.renderTexture = null; // Initial value.
144
- return _this;
145
- }
146
- CocosTextureData.toString = function () {
147
- return '[class dragonBones.CocosTextureData]';
148
- };
149
- CocosTextureData.prototype._onClear = function () {
150
- _super.prototype._onClear.call(this);
151
- if (this.renderTexture !== null) {
152
- this.renderTexture.destroy();
153
- }
154
- this.renderTexture = null;
155
- };
156
- return CocosTextureData;
157
- }(dragonbones_js_1.TextureData));
158
- exports.CocosTextureData = CocosTextureData;
@@ -1,3 +0,0 @@
1
- declare var dragonBones: any;
2
- export { dragonBones };
3
- //# sourceMappingURL=dragonBones.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dragonBones.d.ts","sourceRoot":"","sources":["../../src/dragonbones/dragonBones.ts"],"names":[],"mappings":"AAEA,QAAA,IAAI,WAAW,KAAoB,CAAC;AAkzKpC,OAAO,EAAE,WAAW,EAAE,CAAC"}