Add getWrappedText to mockText

This commit is contained in:
Sirz Benjie 2025-04-06 18:01:17 -05:00
parent ff825605b1
commit 97ecb17637
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -308,5 +308,14 @@ export default class MockText implements MockGameObject {
return this.list;
}
/**
* Runs the word wrap algorithm on the text, then returns an array of the lines
*/
getWrappedText() {
// Returns the wrapped text.
// return this.phaserText.getWrappedText();
return this.runWordWrap(this.text).split("\n");
}
on(_event: string | symbol, _fn: Function, _context?: any) {}
}