add: MockText.on()

This commit is contained in:
flx-sta 2024-09-24 13:19:00 -07:00
parent b4c6f5f240
commit e94e41111b

View File

@ -79,7 +79,14 @@ export default class MockText implements MockGameObject {
return result; return result;
} }
showText(text: string, delay?: integer | null, callback?: Function | null, callbackDelay?: integer | null, prompt?: boolean | null, promptDelay?: integer | null) { showText(
text: string,
delay?: integer | null,
callback?: Function | null,
callbackDelay?: integer | null,
prompt?: boolean | null,
promptDelay?: integer | null
) {
this.scene.messageWrapper.showText(text, delay, callback, callbackDelay, prompt, promptDelay); this.scene.messageWrapper.showText(text, delay, callback, callbackDelay, prompt, promptDelay);
if (callback) { if (callback) {
callback(); callback();
@ -115,16 +122,11 @@ export default class MockText implements MockGameObject {
// return this.phaserText.once(event, callback, source); // return this.phaserText.once(event, callback, source);
} }
off(event, callback, obj) { off(event, callback, obj) {}
}
removedFromScene() { removedFromScene() {}
} addToDisplayList() {}
addToDisplayList() {
}
setStroke(color, thickness) { setStroke(color, thickness) {
// Sets the stroke color and thickness. // Sets the stroke color and thickness.
@ -298,4 +300,6 @@ export default class MockText implements MockGameObject {
getAll() { getAll() {
return this.list; return this.list;
} }
on(_event: string | symbol, _fn: Function, _context?: any) {}
} }