25 lines
431 B
JavaScript
25 lines
431 B
JavaScript
|
export default class UserInterface
|
||
|
{
|
||
|
constructor()
|
||
|
{
|
||
|
this.textBoxes = [];
|
||
|
}
|
||
|
|
||
|
addTextBox(textBox)
|
||
|
{
|
||
|
this.textBoxes.push(textBox);
|
||
|
|
||
|
return this.textBoxes.length - 1;
|
||
|
}
|
||
|
|
||
|
draw(context)
|
||
|
{
|
||
|
this.textBoxes.forEach(
|
||
|
(textBox) => {
|
||
|
if (textBox.isVisible) {
|
||
|
textBox.draw(context);
|
||
|
}
|
||
|
}
|
||
|
)
|
||
|
}
|
||
|
}
|