Tilorswift levels can now be loaded into the running game

This commit is contained in:
Mal
2023-09-17 14:18:21 +02:00
parent 8f087d3dd3
commit 593d323aff
11 changed files with 348 additions and 204 deletions

View File

@@ -2,9 +2,10 @@ import TextAlignment from "./TextAlignment.js";
export default class TextLine
{
constructor(text)
constructor(text, paused)
{
this.text = text;
this.paused = paused;
this.estimatedTextWidth = null;
this.colorText = 'red';
this.colorShadow = 'black';
@@ -24,6 +25,10 @@ export default class TextLine
let process = setInterval(
() => {
if (this.paused) {
return;
}
this.chars++;
if (this.chars === this.text.length) {
@@ -83,4 +88,4 @@ export default class TextLine
context.fillText(this.text.substr(0, this.chars), x + 2, y + this.size + 2);
}
}
}
}