@safe-engine/cocos 1.8.1 → 1.8.2
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/dist/animation/AnimationSystem.js +1 -1
- package/dist/collider/CollideComponent.d.ts +1 -1
- package/dist/collider/CollideComponent.d.ts.map +1 -1
- package/dist/collider/CollideComponent.js +1 -1
- package/dist/collider/CollideSystem.js +1 -1
- package/dist/{gworld/components → core}/EnhancedComponent.d.ts +1 -1
- package/dist/core/EnhancedComponent.d.ts.map +1 -0
- package/dist/{gworld/components → core}/NodeComp.d.ts +1 -1
- package/dist/core/NodeComp.d.ts.map +1 -0
- package/dist/{gworld/components → core}/NodeComp.js +3 -3
- package/dist/{gworld/core → core}/NodePool.d.ts +1 -1
- package/dist/core/NodePool.d.ts.map +1 -0
- package/dist/core/Scene.d.ts +5 -0
- package/dist/core/Scene.d.ts.map +1 -0
- package/dist/{gworld/core → core}/Scene.js +3 -3
- package/dist/{gworld/core → core}/decorator.d.ts +2 -2
- package/dist/core/decorator.d.ts.map +1 -0
- package/dist/{gworld/core → core}/decorator.js +2 -2
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +5 -0
- package/dist/dragonbones/index.d.ts +1 -1
- package/dist/dragonbones/index.d.ts.map +1 -1
- package/dist/dragonbones/index.js +2 -2
- package/dist/gui/GUIComponent.d.ts +1 -1
- package/dist/gui/GUIComponent.d.ts.map +1 -1
- package/dist/gui/GUIComponent.js +1 -1
- package/dist/gui/GUISystem.d.ts.map +1 -1
- package/dist/gui/GUISystem.js +2 -2
- package/dist/gworld/decorator.d.ts +1 -2
- package/dist/gworld/decorator.d.ts.map +1 -1
- package/dist/gworld/decorator.js +1 -2
- package/dist/gworld/index.d.ts +0 -5
- package/dist/gworld/index.d.ts.map +1 -1
- package/dist/gworld/index.js +0 -5
- package/dist/helper/index.d.ts +5 -0
- package/dist/helper/index.d.ts.map +1 -0
- package/dist/helper/index.js +4 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/norender/NoRenderComponent.d.ts +3 -2
- package/dist/norender/NoRenderComponent.d.ts.map +1 -1
- package/dist/norender/NoRenderComponent.js +1 -1
- package/dist/norender/NoRenderSystem.js +1 -1
- package/dist/render/RenderComponent.d.ts +2 -2
- package/dist/render/RenderComponent.d.ts.map +1 -1
- package/dist/render/RenderComponent.js +1 -1
- package/dist/render/RenderSystem.js +1 -1
- package/dist/richtext/RichTextComp.d.ts +1 -1
- package/dist/richtext/RichTextComp.d.ts.map +1 -1
- package/dist/richtext/RichTextComp.js +1 -1
- package/package.json +1 -1
- package/dist/gworld/components/AnimationComponent.d.ts +0 -65
- package/dist/gworld/components/AnimationComponent.d.ts.map +0 -1
- package/dist/gworld/components/AnimationComponent.js +0 -141
- package/dist/gworld/components/CollideComponent.d.ts +0 -64
- package/dist/gworld/components/CollideComponent.d.ts.map +0 -1
- package/dist/gworld/components/CollideComponent.js +0 -265
- package/dist/gworld/components/EnhancedComponent.d.ts.map +0 -1
- package/dist/gworld/components/GUIComponent.d.ts +0 -93
- package/dist/gworld/components/GUIComponent.d.ts.map +0 -1
- package/dist/gworld/components/GUIComponent.js +0 -77
- package/dist/gworld/components/NoRenderComponent.d.ts +0 -38
- package/dist/gworld/components/NoRenderComponent.d.ts.map +0 -1
- package/dist/gworld/components/NoRenderComponent.js +0 -41
- package/dist/gworld/components/NodeComp.d.ts.map +0 -1
- package/dist/gworld/components/RenderComponent.d.ts +0 -52
- package/dist/gworld/components/RenderComponent.d.ts.map +0 -1
- package/dist/gworld/components/RenderComponent.js +0 -84
- package/dist/gworld/core/NodePool.d.ts.map +0 -1
- package/dist/gworld/core/Scene.d.ts +0 -5
- package/dist/gworld/core/Scene.d.ts.map +0 -1
- package/dist/gworld/core/decorator.d.ts.map +0 -1
- package/dist/gworld/systems/AnimationSystem.d.ts +0 -6
- package/dist/gworld/systems/AnimationSystem.d.ts.map +0 -1
- package/dist/gworld/systems/AnimationSystem.js +0 -30
- package/dist/gworld/systems/CollideSystem.d.ts +0 -20
- package/dist/gworld/systems/CollideSystem.d.ts.map +0 -1
- package/dist/gworld/systems/CollideSystem.js +0 -171
- package/dist/gworld/systems/GUISystem.d.ts +0 -15
- package/dist/gworld/systems/GUISystem.d.ts.map +0 -1
- package/dist/gworld/systems/GUISystem.js +0 -112
- package/dist/gworld/systems/NoRenderSystem.d.ts +0 -16
- package/dist/gworld/systems/NoRenderSystem.d.ts.map +0 -1
- package/dist/gworld/systems/NoRenderSystem.js +0 -75
- package/dist/gworld/systems/RenderSystem.d.ts +0 -21
- package/dist/gworld/systems/RenderSystem.d.ts.map +0 -1
- package/dist/gworld/systems/RenderSystem.js +0 -74
- package/dist/helper/html-text-parser.d.ts +0 -30
- package/dist/helper/html-text-parser.d.ts.map +0 -1
- package/dist/helper/html-text-parser.js +0 -354
- /package/dist/{gworld/components → core}/EnhancedComponent.js +0 -0
- /package/dist/{gworld/core → core}/NodePool.js +0 -0
|
@@ -1,141 +0,0 @@
|
|
|
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
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.AnimationComp = exports.AnimationClip = exports.WrapMode = void 0;
|
|
19
|
-
var EnhancedComponent_1 = require("./EnhancedComponent");
|
|
20
|
-
var RenderComponent_1 = require("./RenderComponent");
|
|
21
|
-
var WrapMode;
|
|
22
|
-
(function (WrapMode) {
|
|
23
|
-
WrapMode[WrapMode["Default"] = 0] = "Default";
|
|
24
|
-
WrapMode[WrapMode["Normal"] = 1] = "Normal";
|
|
25
|
-
WrapMode[WrapMode["Loop"] = 2] = "Loop";
|
|
26
|
-
WrapMode[WrapMode["PingPong"] = 22] = "PingPong";
|
|
27
|
-
WrapMode[WrapMode["Reverse"] = 36] = "Reverse";
|
|
28
|
-
WrapMode[WrapMode["LoopReverse"] = 38] = "LoopReverse";
|
|
29
|
-
WrapMode[WrapMode["PingPongReverse"] = 54] = "PingPongReverse";
|
|
30
|
-
})(WrapMode || (exports.WrapMode = WrapMode = {}));
|
|
31
|
-
var AnimationClip = /** @class */ (function () {
|
|
32
|
-
function AnimationClip() {
|
|
33
|
-
this.sample = 60;
|
|
34
|
-
this.speed = 1;
|
|
35
|
-
this.wrapMode = WrapMode.Normal;
|
|
36
|
-
this.events = [];
|
|
37
|
-
this.duration = 0;
|
|
38
|
-
}
|
|
39
|
-
AnimationClip.WrapMode = WrapMode;
|
|
40
|
-
return AnimationClip;
|
|
41
|
-
}());
|
|
42
|
-
exports.AnimationClip = AnimationClip;
|
|
43
|
-
// cc.AnimationClip = AnimationClip;
|
|
44
|
-
var AnimationComp = /** @class */ (function (_super) {
|
|
45
|
-
__extends(AnimationComp, _super);
|
|
46
|
-
function AnimationComp(defaultClip, clips, playOnLoad) {
|
|
47
|
-
var _this = _super.call(this) || this;
|
|
48
|
-
_this.isPaused = true;
|
|
49
|
-
_this.elapsed = 0;
|
|
50
|
-
_this.defaultClip = defaultClip;
|
|
51
|
-
_this.clips = clips;
|
|
52
|
-
_this.playOnLoad = playOnLoad;
|
|
53
|
-
return _this;
|
|
54
|
-
}
|
|
55
|
-
AnimationComp.prototype.start = function () {
|
|
56
|
-
var _this = this;
|
|
57
|
-
if (this.playOnLoad) {
|
|
58
|
-
setTimeout(function () {
|
|
59
|
-
_this.play();
|
|
60
|
-
}, 0);
|
|
61
|
-
}
|
|
62
|
-
// cc.log(this.clips);
|
|
63
|
-
};
|
|
64
|
-
AnimationComp.prototype.update = function (dt) {
|
|
65
|
-
var _this = this;
|
|
66
|
-
if (this.isPaused || !this.node.active) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
var _a = this.currentClip, curveData = _a.curveData, wrapMode = _a.wrapMode, events = _a.events, duration = _a.duration, speed = _a.speed;
|
|
70
|
-
this.elapsed += dt * speed;
|
|
71
|
-
var _b = curveData.comps, spriteFrame = _b.spriteFrame, nextFrame = _b.nextFrame;
|
|
72
|
-
var nextFrameTime = spriteFrame[nextFrame].frame;
|
|
73
|
-
events.forEach(function (evt) {
|
|
74
|
-
var func = evt.func, frame = evt.frame, params = evt.params, isCalled = evt.isCalled;
|
|
75
|
-
if (!isCalled && _this.elapsed >= frame) {
|
|
76
|
-
evt.isCalled = true;
|
|
77
|
-
// this.node.emit(func, ...params)
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
if (this.elapsed >= nextFrameTime) {
|
|
81
|
-
var imageComp = this.node.getComponent(RenderComponent_1.SpriteRender);
|
|
82
|
-
if (imageComp) {
|
|
83
|
-
imageComp.spriteFrame = spriteFrame[nextFrame].value;
|
|
84
|
-
}
|
|
85
|
-
// cc.log(spriteFrame[nextFrame].value, nextFrameTime);
|
|
86
|
-
curveData.comps.nextFrame += 1;
|
|
87
|
-
curveData.comps.nextFrame = cc.clampf(curveData.comps.nextFrame, 0, spriteFrame.length - 1);
|
|
88
|
-
if (this.elapsed >= duration) {
|
|
89
|
-
if (wrapMode === WrapMode.Loop) {
|
|
90
|
-
curveData.comps.nextFrame = 0;
|
|
91
|
-
this.elapsed = 0;
|
|
92
|
-
events.forEach(function (evt) {
|
|
93
|
-
evt.isCalled = false;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
this.isPaused = true;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
AnimationComp.prototype.getAnimationState = function (name) {
|
|
103
|
-
return {
|
|
104
|
-
isPlaying: !this.isPaused,
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
AnimationComp.prototype.play = function (name) {
|
|
108
|
-
this.elapsed = 0;
|
|
109
|
-
// cc.log('play', name, this.defaultClip.name);
|
|
110
|
-
if (!name) {
|
|
111
|
-
if (!this.defaultClip) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
name = this.defaultClip.name;
|
|
115
|
-
}
|
|
116
|
-
else if (this.currentClip && name === this.currentClip.name) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this.currentClip = this.clips.find(function (clip) { return clip.name === name; });
|
|
120
|
-
this.currentClip.curveData.comps.nextFrame = 0;
|
|
121
|
-
// cc.log('name', name, this.currentClip);
|
|
122
|
-
this.currentClip.events.forEach(function (evt) {
|
|
123
|
-
evt.isCalled = false;
|
|
124
|
-
});
|
|
125
|
-
this.isPaused = false;
|
|
126
|
-
};
|
|
127
|
-
AnimationComp.prototype.pause = function () {
|
|
128
|
-
this.node.instance.pause();
|
|
129
|
-
this.isPaused = true;
|
|
130
|
-
};
|
|
131
|
-
AnimationComp.prototype.resume = function () {
|
|
132
|
-
this.node.instance.resume();
|
|
133
|
-
this.isPaused = false;
|
|
134
|
-
};
|
|
135
|
-
AnimationComp.prototype.stop = function (name) {
|
|
136
|
-
this.node.instance.unscheduleAllCallbacks();
|
|
137
|
-
this.isPaused = true;
|
|
138
|
-
};
|
|
139
|
-
return AnimationComp;
|
|
140
|
-
}(EnhancedComponent_1.EnhancedComponent));
|
|
141
|
-
exports.AnimationComp = AnimationComp;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Vec2 } from '../../polyfills';
|
|
2
|
-
import { NoRenderComponentX } from '../decorator';
|
|
3
|
-
interface ColliderProps {
|
|
4
|
-
offset?: Vec2;
|
|
5
|
-
tag?: number;
|
|
6
|
-
enabled?: boolean;
|
|
7
|
-
onCollisionEnter?: (other: Collider) => void;
|
|
8
|
-
onCollisionExit?: (other: Collider) => void;
|
|
9
|
-
onCollisionStay?: (other: Collider) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare class Collider<T = ColliderProps> extends NoRenderComponentX<T> {
|
|
12
|
-
_worldPoints: cc.Vec2[] | cc.Point[];
|
|
13
|
-
_worldPosition: cc.Vec2 | cc.Point;
|
|
14
|
-
_worldRadius: any;
|
|
15
|
-
_AABB: cc.Rect;
|
|
16
|
-
_preAabb: cc.Rect;
|
|
17
|
-
getAABB(): cc.Rect;
|
|
18
|
-
get world(): {
|
|
19
|
-
points: cc.Point[] | cc.Vec2[];
|
|
20
|
-
preAabb: cc.Rect;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
interface BoxColliderProps extends ColliderProps {
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
}
|
|
27
|
-
export declare class BoxCollider extends Collider<BoxColliderProps> {
|
|
28
|
-
get size(): cc.Size;
|
|
29
|
-
set size(s: cc.Size);
|
|
30
|
-
update(dt: any, draw: cc.DrawNode): void;
|
|
31
|
-
}
|
|
32
|
-
interface CircleColliderProps extends ColliderProps {
|
|
33
|
-
radius: number;
|
|
34
|
-
}
|
|
35
|
-
export declare class CircleCollider extends Collider<CircleColliderProps> {
|
|
36
|
-
update(dt: any, draw: cc.DrawNode): void;
|
|
37
|
-
}
|
|
38
|
-
interface PolygonColliderProps extends ColliderProps {
|
|
39
|
-
points: Array<Vec2>;
|
|
40
|
-
}
|
|
41
|
-
export declare class PolygonCollider extends Collider<PolygonColliderProps> {
|
|
42
|
-
get points(): Vec2[];
|
|
43
|
-
set points(points: Vec2[]);
|
|
44
|
-
update(dt: any, draw: cc.DrawNode): void;
|
|
45
|
-
}
|
|
46
|
-
export declare enum CollisionType {
|
|
47
|
-
NONE = 0,
|
|
48
|
-
ENTER = 1,
|
|
49
|
-
STAY = 2,
|
|
50
|
-
EXIT = 3
|
|
51
|
-
}
|
|
52
|
-
export declare class Contract {
|
|
53
|
-
_collider1: Collider;
|
|
54
|
-
_collider2: Collider;
|
|
55
|
-
_touching: boolean;
|
|
56
|
-
_isPolygonPolygon: boolean;
|
|
57
|
-
_isCircleCircle: boolean;
|
|
58
|
-
_isPolygonCircle: boolean;
|
|
59
|
-
constructor(collider1: Collider, collider2: Collider);
|
|
60
|
-
updateState(): CollisionType;
|
|
61
|
-
test(): any;
|
|
62
|
-
}
|
|
63
|
-
export { };
|
|
64
|
-
//# sourceMappingURL=CollideComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CollideComponent.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/CollideComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAYtD,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,IAAI,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAA;IAC5C,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAA;IAC3C,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAA;CAC5C;AACD,qBAAa,QAAQ,CAAC,CAAC,GAAG,aAAa,CAAE,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IACpE,YAAY,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAK;IACzC,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,SAAS,EAAE,OAAO,CAAA;IAClB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,eAAe,EAAE,OAAO,CAAA;IACxB,gBAAgB,EAAE,OAAO,CAAA;gBAEb,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;IAsBpD,WAAW;IAeX,IAAI;CAyBL"}
|
|
@@ -1,265 +0,0 @@
|
|
|
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
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.Contract = exports.CollisionType = exports.PolygonCollider = exports.CircleCollider = exports.BoxCollider = exports.Collider = void 0;
|
|
19
|
-
var math_1 = require("../../helper/math");
|
|
20
|
-
var polyfills_1 = require("../../polyfills");
|
|
21
|
-
var decorator_1 = require("../core/decorator");
|
|
22
|
-
function getNodeToWorldTransformAR(node) {
|
|
23
|
-
var t = node.instance.getNodeToWorldTransform();
|
|
24
|
-
var anchorPointSize = node.instance.getAnchorPointInPoints();
|
|
25
|
-
var transform = cc.affineTransformTranslate(t, anchorPointSize.x, anchorPointSize.y);
|
|
26
|
-
return transform;
|
|
27
|
-
}
|
|
28
|
-
function cloneRect(origin) {
|
|
29
|
-
return cc.rect(origin.x, origin.y, origin.width, origin.height);
|
|
30
|
-
}
|
|
31
|
-
var Collider = /** @class */ (function (_super) {
|
|
32
|
-
__extends(Collider, _super);
|
|
33
|
-
function Collider() {
|
|
34
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
-
_this._worldPoints = [];
|
|
36
|
-
_this._AABB = cc.rect(0, 0, 0, 0);
|
|
37
|
-
_this._preAabb = cc.rect(0, 0, 0, 0);
|
|
38
|
-
return _this;
|
|
39
|
-
}
|
|
40
|
-
// update(dt: number, draw?: cc.DrawNode) {}
|
|
41
|
-
Collider.prototype.getAABB = function () {
|
|
42
|
-
var collider = this.getComponent(Collider);
|
|
43
|
-
if (collider)
|
|
44
|
-
return collider._AABB;
|
|
45
|
-
return this._AABB;
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperty(Collider.prototype, "world", {
|
|
48
|
-
get: function () {
|
|
49
|
-
return {
|
|
50
|
-
points: this._worldPoints,
|
|
51
|
-
preAabb: this._preAabb,
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
enumerable: false,
|
|
55
|
-
configurable: true
|
|
56
|
-
});
|
|
57
|
-
return Collider;
|
|
58
|
-
}(decorator_1.NoRenderComponentX));
|
|
59
|
-
exports.Collider = Collider;
|
|
60
|
-
var BoxCollider = /** @class */ (function (_super) {
|
|
61
|
-
__extends(BoxCollider, _super);
|
|
62
|
-
function BoxCollider() {
|
|
63
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
|
-
}
|
|
65
|
-
Object.defineProperty(BoxCollider.prototype, "size", {
|
|
66
|
-
get: function () {
|
|
67
|
-
return cc.size(this.props.width, this.props.height);
|
|
68
|
-
},
|
|
69
|
-
set: function (s) {
|
|
70
|
-
this.props.width = s.width;
|
|
71
|
-
this.props.height = s.height;
|
|
72
|
-
},
|
|
73
|
-
enumerable: false,
|
|
74
|
-
configurable: true
|
|
75
|
-
});
|
|
76
|
-
BoxCollider.prototype.update = function (dt, draw) {
|
|
77
|
-
if (!this.node) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
var collider = this.getComponent(Collider);
|
|
81
|
-
var _a = collider.props.offset || (0, polyfills_1.Vec2)(0, 0), x = _a.x, y = _a.y;
|
|
82
|
-
var hw = this.props.width * 0.5;
|
|
83
|
-
var hh = this.props.height * 0.5;
|
|
84
|
-
var transform = getNodeToWorldTransformAR(this.node);
|
|
85
|
-
var rect = cc.rect(x - hw, y - hh, this.props.width, this.props.height);
|
|
86
|
-
var rectTrs = cc.rectApplyAffineTransform(rect, transform);
|
|
87
|
-
// cc.log(rectTrs);
|
|
88
|
-
collider._worldPoints[0] = (0, polyfills_1.Vec2)(rectTrs.x, rectTrs.y);
|
|
89
|
-
collider._worldPoints[1] = (0, polyfills_1.Vec2)(rectTrs.x, rectTrs.y + rectTrs.height);
|
|
90
|
-
collider._worldPoints[2] = (0, polyfills_1.Vec2)(rectTrs.x + rectTrs.width, rectTrs.y + rectTrs.height);
|
|
91
|
-
collider._worldPoints[3] = (0, polyfills_1.Vec2)(rectTrs.x + rectTrs.width, rectTrs.y);
|
|
92
|
-
var listX = collider._worldPoints.map(function (_a) {
|
|
93
|
-
var x = _a.x;
|
|
94
|
-
return x;
|
|
95
|
-
});
|
|
96
|
-
var listY = collider._worldPoints.map(function (_a) {
|
|
97
|
-
var y = _a.y;
|
|
98
|
-
return y;
|
|
99
|
-
});
|
|
100
|
-
collider._preAabb = cloneRect(collider._AABB);
|
|
101
|
-
collider._AABB.x = (0, math_1.getMin)(listX);
|
|
102
|
-
collider._AABB.y = (0, math_1.getMin)(listY);
|
|
103
|
-
collider._AABB.width = (0, math_1.getMax)(listX) - collider._AABB.x;
|
|
104
|
-
collider._AABB.height = (0, math_1.getMax)(listY) - collider._AABB.y;
|
|
105
|
-
if (draw) {
|
|
106
|
-
draw.drawPoly(collider._worldPoints, null, 3, cc.Color.DEBUG_BORDER_COLOR);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
return BoxCollider;
|
|
110
|
-
}(Collider));
|
|
111
|
-
exports.BoxCollider = BoxCollider;
|
|
112
|
-
var CircleCollider = /** @class */ (function (_super) {
|
|
113
|
-
__extends(CircleCollider, _super);
|
|
114
|
-
function CircleCollider() {
|
|
115
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
116
|
-
}
|
|
117
|
-
CircleCollider.prototype.update = function (dt, draw) {
|
|
118
|
-
if (!this.node) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
var transform = getNodeToWorldTransformAR(this.node);
|
|
122
|
-
var collider = this.getComponent(Collider);
|
|
123
|
-
collider._worldRadius = this.props.radius * this.node.scaleX;
|
|
124
|
-
collider._worldPosition = cc.pointApplyAffineTransform(collider.props.offset, transform);
|
|
125
|
-
if (draw) {
|
|
126
|
-
draw.drawDot(collider._worldPosition, collider._worldRadius, cc.Color.DEBUG_FILL_COLOR);
|
|
127
|
-
draw.drawCircle(collider._worldPosition, collider._worldRadius, 0, 64, true, 3, cc.Color.DEBUG_BORDER_COLOR);
|
|
128
|
-
}
|
|
129
|
-
collider._preAabb = cloneRect(collider._AABB);
|
|
130
|
-
collider._AABB.x = collider._worldPosition.x - collider._worldRadius;
|
|
131
|
-
collider._AABB.y = collider._worldPosition.y - collider._worldRadius;
|
|
132
|
-
collider._AABB.width = collider._worldRadius * 2;
|
|
133
|
-
collider._AABB.height = collider._AABB.width;
|
|
134
|
-
// draw.drawRect(cc.p(this._AABB.x, this._AABB.y),
|
|
135
|
-
// cc.p(this._worldPosition.x + this._worldRadius, this._worldPosition.y + this._worldRadius),
|
|
136
|
-
// cc.Color.WHITE, 3, cc.Color.DEBUG_BORDER_COLOR);
|
|
137
|
-
};
|
|
138
|
-
return CircleCollider;
|
|
139
|
-
}(Collider));
|
|
140
|
-
exports.CircleCollider = CircleCollider;
|
|
141
|
-
var PolygonCollider = /** @class */ (function (_super) {
|
|
142
|
-
__extends(PolygonCollider, _super);
|
|
143
|
-
function PolygonCollider() {
|
|
144
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
145
|
-
}
|
|
146
|
-
Object.defineProperty(PolygonCollider.prototype, "points", {
|
|
147
|
-
get: function () {
|
|
148
|
-
var _a = this.props.offset, x = _a.x, y = _a.y;
|
|
149
|
-
var pointsList = this.props.points.map(function (p) { return (0, polyfills_1.Vec2)(p.x + x, p.y + y); });
|
|
150
|
-
return pointsList;
|
|
151
|
-
},
|
|
152
|
-
set: function (points) {
|
|
153
|
-
this.props.points = points;
|
|
154
|
-
},
|
|
155
|
-
enumerable: false,
|
|
156
|
-
configurable: true
|
|
157
|
-
});
|
|
158
|
-
PolygonCollider.prototype.update = function (dt, draw) {
|
|
159
|
-
if (!this.node) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
var transform = getNodeToWorldTransformAR(this.node);
|
|
163
|
-
var collider = this.getComponent(Collider);
|
|
164
|
-
collider._worldPoints = this.points.map(function (p) { return cc.pointApplyAffineTransform(p, transform); });
|
|
165
|
-
// cc.log(polyPoints);
|
|
166
|
-
if (draw) {
|
|
167
|
-
draw.drawPoly(collider._worldPoints, cc.Color.DEBUG_FILL_COLOR, 3, cc.Color.DEBUG_BORDER_COLOR);
|
|
168
|
-
}
|
|
169
|
-
var listX = collider._worldPoints.map(function (_a) {
|
|
170
|
-
var x = _a.x;
|
|
171
|
-
return x;
|
|
172
|
-
});
|
|
173
|
-
var listY = collider._worldPoints.map(function (_a) {
|
|
174
|
-
var y = _a.y;
|
|
175
|
-
return y;
|
|
176
|
-
});
|
|
177
|
-
collider._preAabb = cloneRect(collider._AABB);
|
|
178
|
-
collider._AABB.x = (0, math_1.getMin)(listX);
|
|
179
|
-
collider._AABB.y = (0, math_1.getMin)(listY);
|
|
180
|
-
collider._AABB.width = (0, math_1.getMax)(listX) - collider._AABB.x;
|
|
181
|
-
collider._AABB.height = (0, math_1.getMax)(listY) - collider._AABB.y;
|
|
182
|
-
// draw.drawRect(cc.p(this._AABB.x, this._AABB.y), cc.p(max(listX), max(listY)),
|
|
183
|
-
// cc.Color.WHITE, 3, cc.Color.DEBUG_BORDER_COLOR);
|
|
184
|
-
};
|
|
185
|
-
return PolygonCollider;
|
|
186
|
-
}(Collider));
|
|
187
|
-
exports.PolygonCollider = PolygonCollider;
|
|
188
|
-
var CollisionType;
|
|
189
|
-
(function (CollisionType) {
|
|
190
|
-
CollisionType[CollisionType["NONE"] = 0] = "NONE";
|
|
191
|
-
CollisionType[CollisionType["ENTER"] = 1] = "ENTER";
|
|
192
|
-
CollisionType[CollisionType["STAY"] = 2] = "STAY";
|
|
193
|
-
CollisionType[CollisionType["EXIT"] = 3] = "EXIT";
|
|
194
|
-
})(CollisionType || (exports.CollisionType = CollisionType = {}));
|
|
195
|
-
function isPolygonCollider(col) {
|
|
196
|
-
return col.getComponent(PolygonCollider) || col.getComponent(BoxCollider);
|
|
197
|
-
}
|
|
198
|
-
function isCircleCollider(col) {
|
|
199
|
-
return col.getComponent(CircleCollider);
|
|
200
|
-
}
|
|
201
|
-
var Contract = /** @class */ (function () {
|
|
202
|
-
function Contract(collider1, collider2) {
|
|
203
|
-
this._collider1 = collider1;
|
|
204
|
-
this._collider2 = collider2;
|
|
205
|
-
var isCollider1Polygon = isPolygonCollider(collider1);
|
|
206
|
-
var isCollider2Polygon = isPolygonCollider(collider2);
|
|
207
|
-
var isCollider1Circle = isCircleCollider(collider1);
|
|
208
|
-
var isCollider2Circle = isCircleCollider(collider2);
|
|
209
|
-
if (isCollider1Polygon && isCollider2Polygon) {
|
|
210
|
-
this._isPolygonPolygon = true;
|
|
211
|
-
}
|
|
212
|
-
else if (isCollider1Circle && isCollider2Circle) {
|
|
213
|
-
this._isCircleCircle = true;
|
|
214
|
-
}
|
|
215
|
-
else if (isCollider1Polygon && isCollider2Circle) {
|
|
216
|
-
this._isPolygonCircle = true;
|
|
217
|
-
}
|
|
218
|
-
else if (isCollider1Circle && isCollider2Polygon) {
|
|
219
|
-
this._isPolygonCircle = true;
|
|
220
|
-
this._collider1 = collider2;
|
|
221
|
-
this._collider2 = collider1;
|
|
222
|
-
}
|
|
223
|
-
// cc.log(this._isPolygonPolygon);
|
|
224
|
-
}
|
|
225
|
-
Contract.prototype.updateState = function () {
|
|
226
|
-
var result = this.test();
|
|
227
|
-
var type = CollisionType.NONE;
|
|
228
|
-
if (result && !this._touching) {
|
|
229
|
-
this._touching = true;
|
|
230
|
-
type = CollisionType.ENTER;
|
|
231
|
-
}
|
|
232
|
-
else if (result && this._touching) {
|
|
233
|
-
type = CollisionType.STAY;
|
|
234
|
-
}
|
|
235
|
-
else if (!result && this._touching) {
|
|
236
|
-
this._touching = false;
|
|
237
|
-
type = CollisionType.EXIT;
|
|
238
|
-
}
|
|
239
|
-
return type;
|
|
240
|
-
};
|
|
241
|
-
Contract.prototype.test = function () {
|
|
242
|
-
// if (!shouldCollider(this._collider1, this._collider2)) {
|
|
243
|
-
// return false;
|
|
244
|
-
// }
|
|
245
|
-
// cc.log(this._collider1.getAABB(), this._collider2.getAABB());
|
|
246
|
-
if (!cc.rectIntersectsRect(this._collider1.getAABB(), this._collider2.getAABB())) {
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
if (this._isPolygonPolygon) {
|
|
250
|
-
return cc.Intersection.polygonPolygon(this._collider1._worldPoints, this._collider2._worldPoints);
|
|
251
|
-
}
|
|
252
|
-
if (this._isCircleCircle) {
|
|
253
|
-
var p1 = this._collider1;
|
|
254
|
-
var p2 = this._collider2;
|
|
255
|
-
return cc.Intersection.circleCircle(p1._worldPosition, p1._worldRadius, p2._worldPosition, p2._worldRadius);
|
|
256
|
-
}
|
|
257
|
-
if (this._isPolygonCircle) {
|
|
258
|
-
var p2 = this._collider2;
|
|
259
|
-
return cc.Intersection.polygonCircle(this._collider1._worldPoints, p2._worldPosition, p2._worldRadius);
|
|
260
|
-
}
|
|
261
|
-
return false;
|
|
262
|
-
};
|
|
263
|
-
return Contract;
|
|
264
|
-
}());
|
|
265
|
-
exports.Contract =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,sBAAsB,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAG7E,OAAO,CAAC,KAAK,EAAE,iBAAiB;CAGjC;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,QAAQ,CAAA"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { ComponentX, NoRenderComponentX } from '../gworld/core/decorator';
|
|
2
|
-
import { Color4B, Size, Vec2 } from '../polyfills';
|
|
3
|
-
import { BaseComponentProps, ColorSource } from '../safex';
|
|
4
|
-
export declare const FillType: {
|
|
5
|
-
HORIZONTAL: number;
|
|
6
|
-
VERTICAL: number;
|
|
7
|
-
RADIAL: number;
|
|
8
|
-
};
|
|
9
|
-
type Keys = keyof typeof FillType;
|
|
10
|
-
type Values = (typeof FillType)[Keys];
|
|
11
|
-
interface ButtonCompProps {
|
|
12
|
-
normalImage?: string;
|
|
13
|
-
selectedImage?: string;
|
|
14
|
-
disableImage?: string;
|
|
15
|
-
zoomScale?: number;
|
|
16
|
-
onPress?: (target: ButtonComp) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare class ButtonComp extends NoRenderComponentX<ButtonCompProps> {
|
|
19
|
-
clickEvents: any[];
|
|
20
|
-
setOnPress(cb: (target: ButtonComp) => void): void;
|
|
21
|
-
}
|
|
22
|
-
interface ProgressTimerProps {
|
|
23
|
-
spriteFrame: string;
|
|
24
|
-
fillType?: number;
|
|
25
|
-
fillRange?: number;
|
|
26
|
-
fillCenter?: Vec2;
|
|
27
|
-
isReverse?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare class ProgressTimerComp extends ComponentX<ProgressTimerProps & BaseComponentProps<ProgressTimerComp>, cc.ProgressTimer & cc.Node> {
|
|
30
|
-
spriteFrame: string;
|
|
31
|
-
fillType: Values;
|
|
32
|
-
fillRange: number;
|
|
33
|
-
fillCenter: Vec2;
|
|
34
|
-
isReverse: boolean;
|
|
35
|
-
getFillRange(): number;
|
|
36
|
-
setFillStart(val: number): void;
|
|
37
|
-
setFillRange(val: number): void;
|
|
38
|
-
}
|
|
39
|
-
interface LabelCompProps {
|
|
40
|
-
font?: string;
|
|
41
|
-
string?: string;
|
|
42
|
-
size?: number;
|
|
43
|
-
}
|
|
44
|
-
interface LabelOutlineCompProps {
|
|
45
|
-
color: ColorSource;
|
|
46
|
-
width: number;
|
|
47
|
-
}
|
|
48
|
-
interface LabelShadowCompProps {
|
|
49
|
-
color: ColorSource;
|
|
50
|
-
blur: number;
|
|
51
|
-
offset: Vec2;
|
|
52
|
-
}
|
|
53
|
-
export declare class LabelComp extends ComponentX<LabelCompProps & BaseComponentProps<LabelComp>, ccui.Text> {
|
|
54
|
-
get string(): string;
|
|
55
|
-
set string(val: string);
|
|
56
|
-
}
|
|
57
|
-
export declare class LabelOutlineComp extends NoRenderComponentX<LabelOutlineCompProps> {
|
|
58
|
-
color: typeof Color4B;
|
|
59
|
-
width: Float;
|
|
60
|
-
}
|
|
61
|
-
export declare class LabelShadowComp extends NoRenderComponentX<LabelShadowCompProps> {
|
|
62
|
-
color: typeof Color4B;
|
|
63
|
-
blur: Float;
|
|
64
|
-
offset: Size;
|
|
65
|
-
}
|
|
66
|
-
export declare enum ScrollViewDirection {
|
|
67
|
-
NONE,
|
|
68
|
-
HORIZONTAL,
|
|
69
|
-
VERTICAL,
|
|
70
|
-
BOTH
|
|
71
|
-
}
|
|
72
|
-
interface ScrollViewProps {
|
|
73
|
-
viewSize: Size;
|
|
74
|
-
contentSize: Size;
|
|
75
|
-
direction?: ScrollViewDirection;
|
|
76
|
-
}
|
|
77
|
-
export declare class ScrollViewComp extends ComponentX<ScrollViewProps & BaseComponentProps<ScrollViewComp>, cc.ScrollView> {
|
|
78
|
-
zoom(scale: number): void;
|
|
79
|
-
}
|
|
80
|
-
interface InputCompProps {
|
|
81
|
-
placeHolder?: string;
|
|
82
|
-
font?: string;
|
|
83
|
-
size?: Integer;
|
|
84
|
-
maxLength?: Integer;
|
|
85
|
-
isPassword?: boolean;
|
|
86
|
-
}
|
|
87
|
-
export declare class InputComp extends ComponentX<InputCompProps & BaseComponentProps<InputComp>, ccui.TextField> {
|
|
88
|
-
get string(): string;
|
|
89
|
-
}
|
|
90
|
-
export declare class BlockInputEventsComp extends NoRenderComponentX {
|
|
91
|
-
}
|
|
92
|
-
export { };
|
|
93
|
-
//# sourceMappingURL=GUIComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GUIComponent.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/GUIComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAElE,eAAO,MAAM,QAAQ;;;;CAIpB,CAAA;AACD,KAAK,IAAI,GAAG,MAAM,OAAO,QAAQ,CAAA;AACjC,KAAK,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA;AAErC,UAAU,eAAe;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;CACvC;AACD,qBAAa,UAAW,SAAQ,kBAAkB,CAAC,eAAe,CAAC;IAEjE,WAAW,QAAK;IAEhB,UAAU,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI;CAO5C;AAED,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,E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AI,EAAE,KAAK,CAAA;IACX,MAAM,EAAE,IAAI,CAAA;CACb;AAED,oBAAY,mBAAmB;IAC7B,IAAmC;IACnC,UAA+C;IAC/C,QAA2C;IAC3C,IAAmC;CACpC;AACD,UAAU,eAAe;IACvB,QAAQ,EAAE,IAAI,CAAA;IACd,WAAW,EAAE,IAAI,CAAA;IACjB,SAAS,CAAC,EAAE,mBAAmB,CAAA;CAChC;AACD,qBAAa,cAAe,SAAQ,UAAU,CAAC,eAAe,GAAG,kBAAkB,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC;IACjH,IAAI,CAAC,KAAK,EAAE,MAAM;CAKnB;AAED,UAAU,cAAc;IACtB,WAAW,CAAC,EAAE,MAAM,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;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;CAAG"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Vec2 } from '../../polyfills';
|
|
2
|
-
import { ComponentX, NoRenderComponentX } from '../core/decorator';
|
|
3
|
-
export const FillType = {
|
|
4
|
-
HORIZONTAL: 0,
|
|
5
|
-
VERTICAL: 1,
|
|
6
|
-
RADIAL: 2,
|
|
7
|
-
};
|
|
8
|
-
export class ButtonComp extends NoRenderComponentX {
|
|
9
|
-
// texType: ccui.Widget.TextureType
|
|
10
|
-
clickEvents = [];
|
|
11
|
-
setOnPress(cb) {
|
|
12
|
-
this.props.onPress = cb;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export class ProgressTimerComp extends ComponentX {
|
|
16
|
-
spriteFrame;
|
|
17
|
-
fillType;
|
|
18
|
-
fillRange;
|
|
19
|
-
fillCenter;
|
|
20
|
-
isReverse;
|
|
21
|
-
getFillRange() {
|
|
22
|
-
if (this.node.instance instanceof cc.ProgressTimer) {
|
|
23
|
-
return this.node.instance.getPercentage() * 0.01;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
setFillStart(val) {
|
|
27
|
-
if (this.node.instance instanceof cc.ProgressTimer) {
|
|
28
|
-
this.node.instance.setMidpoint(Vec2(val, val));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
setFillRange(val) {
|
|
32
|
-
if (this.node.instance instanceof cc.ProgressTimer) {
|
|
33
|
-
this.node.instance.setPercentage(val * 100);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export class LabelComp extends ComponentX {
|
|
38
|
-
get string() {
|
|
39
|
-
return this.props.string;
|
|
40
|
-
}
|
|
41
|
-
set string(val) {
|
|
42
|
-
this.props.string = val;
|
|
43
|
-
if (this.node.instance instanceof ccui.Text) {
|
|
44
|
-
this.node.instance.setString(val);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
export class LabelOutlineComp extends NoRenderComponentX {
|
|
49
|
-
color;
|
|
50
|
-
width;
|
|
51
|
-
}
|
|
52
|
-
export class LabelShadowComp extends NoRenderComponentX {
|
|
53
|
-
color;
|
|
54
|
-
blur;
|
|
55
|
-
offset;
|
|
56
|
-
}
|
|
57
|
-
export var ScrollViewDirection;
|
|
58
|
-
(function (ScrollViewDirection) {
|
|
59
|
-
ScrollViewDirection[ScrollViewDirection["NONE"] = cc.SCROLLVIEW_DIRECTION_NONE] = "NONE";
|
|
60
|
-
ScrollViewDirection[ScrollViewDirection["HORIZONTAL"] = cc.SCROLLVIEW_DIRECTION_HORIZONTAL] = "HORIZONTAL";
|
|
61
|
-
ScrollViewDirection[ScrollViewDirection["VERTICAL"] = cc.SCROLLVIEW_DIRECTION_VERTICAL] = "VERTICAL";
|
|
62
|
-
ScrollViewDirection[ScrollViewDirection["BOTH"] = cc.SCROLLVIEW_DIRECTION_BOTH] = "BOTH";
|
|
63
|
-
})(ScrollViewDirection || (ScrollViewDirection = {}));
|
|
64
|
-
export class ScrollViewComp extends ComponentX {
|
|
65
|
-
zoom(scale) {
|
|
66
|
-
if (this.node.instance instanceof cc.ScrollView) {
|
|
67
|
-
this.node.instance.getContainer().setScale(scale);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export class InputComp extends ComponentX {
|
|
72
|
-
get string() {
|
|
73
|
-
return this.node.instance.getString();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
export class BlockInputEventsComp extends NoRenderComponentX {
|
|
77
|
-
}
|