const asdf = require("asdf-games"); // eslint-disable-next-line no-unused-vars const { Texture, Text, Container, Sprite } = asdf; const text = require(__dirname + "/../../res/lang/default.js"); const fillStyle = {fill: "#ffffff", font: "24px Arial"}; class Logo extends Container { constructor(game, onEnd) { super(); this.game = game; this.onEnd = onEnd; this.children = []; const textPos = { x: 200, y: 150 }; for (let index = 0; index < text.logoScreen.length; index++) { const element = new Text(text.logoScreen[index], fillStyle); element.pos = { x: textPos.x, y: textPos.y + 24 * index }; this.add(element); } this.lifetime = 2; } update(dt, t) { super.update(dt, t); if (this.lifetime <= 0) { this.onEnd(); } else { this.lifetime -= dt; } } } module.exports = Logo;