Skip to content

Commit 58a60b6

Browse files
committed
UIComponentPrototype lockClip
1 parent ff53c20 commit 58a60b6

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/components/UIButton.js

+4
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ export default class UIButton extends UIComponentPrototype {
121121
return this._hitZone ? this._hitZone.getBounds() : null;
122122
}
123123

124+
get lockClip() {
125+
return this._hitZone;
126+
}
127+
124128
/**
125129
* @method PhaserComps.UIComponents.UIButton#_updateInteractive
126130
* @private

src/components/UIComponentPrototype.js

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ export default class UIComponentPrototype extends Phaser.Events.EventEmitter {
100100
*/
101101
get lockClipBounds() { return null; } // override
102102

103+
/** @return {Phaser.GameObjects.GameObject|*} */
104+
get lockClip() { return null; } // override
105+
103106
/** @param {string} value */
104107
set lockId(value) {
105108
if (this._lockId === value) {

src/manager/UIManager.js

+9
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,13 @@ export default class UIManager {
8484
return proto ? proto.lockClipBounds : null;
8585
}
8686

87+
/**
88+
* @param {string} id
89+
* @returns {Phaser.GameObjects.GameObject|*}
90+
*/
91+
static getClipById(id) {
92+
const proto = this.getById(id);
93+
return proto ? proto.lockClip : null;
94+
}
95+
8796
}

0 commit comments

Comments
 (0)