2020-02-24 21:09:21 +01:00
|
|
|
import TextBox from "./TextBox.js";
|
|
|
|
import GeometryPoint from "../geometry/GeometryPoint.js";
|
|
|
|
|
|
|
|
export default class TextMessage extends TextBox
|
|
|
|
{
|
2023-09-17 14:18:21 +02:00
|
|
|
constructor(text, context, paused = false) {
|
|
|
|
super(text, window.innerWidth - 40, context, paused);
|
2020-02-24 21:09:21 +01:00
|
|
|
this.update();
|
|
|
|
this.context = context;
|
|
|
|
}
|
|
|
|
|
|
|
|
update()
|
|
|
|
{
|
|
|
|
this.defaultWidth = window.innerWidth - 40;
|
|
|
|
this.defaultPosition = new GeometryPoint(window.innerWidth * 0.5, window.innerHeight - 100);
|
|
|
|
}
|
|
|
|
|
|
|
|
render()
|
|
|
|
{
|
|
|
|
this.update();
|
|
|
|
this.setPosition(this.defaultPosition.x, this.defaultPosition.y);
|
|
|
|
this.updateLines(this.defaultWidth, this.context);
|
|
|
|
}
|
2023-09-17 14:18:21 +02:00
|
|
|
}
|