UserInterface with TextMessages implemented.

This commit is contained in:
Mal
2020-02-24 21:09:21 +01:00
parent 88d1c0db87
commit 479a150f9d
9 changed files with 167 additions and 41 deletions

View File

@@ -0,0 +1,38 @@
import GeometryPoint from "../geometry/GeometryPoint.js";
export default class UserInterfaceElement
{
constructor()
{
this.position = new GeometryPoint(0, 0);
this.isVisible = true;
}
setPosition(x, y)
{
this.position.x = x;
this.position.y = y;
}
hide(timeoutMilliseconds = 0)
{
setTimeout(
() => {
this.isVisible = false
}, timeoutMilliseconds
);
}
show(timeoutMilliseconds = 0)
{
if (timeoutMilliseconds > 0) {
this.isVisible = false;
}
setTimeout(
() => {
this.isVisible = true;
}, timeoutMilliseconds
);
}
}