class WelcomePlayerText extends Phaser.Text { constructor(playerName) { super(game, game.world.width / 2, WelcomePlayerText.FONT_HEIGHT_PX, "어서오세요, " + playerName + "님", WelcomePlayerText.DEFAULT_TEXT_FONT); this.anchor.set(0.5); this.inputEnabled = false; var grd = this.context.createLinearGradient(0, 0, 0, this.height); grd.addColorStop(0, '#8ED6FF'); grd.addColorStop(1, '#4C6CB3'); this.fill = grd; this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2); this.stroke = '#000'; this.strokeThickness = 5; let tweenAlpha = game.add.tween(this); tweenAlpha.from( { alpha: 0 } ).to( { alpha: 100 }, 1000, Phaser.Easing.Linear.None, true); /* let tweenAlpha = game.add.tween(this); tweenAlpha.to( { alpha: 0 }, 1000, Phaser.Easing.Linear.None, true); let tweenMoveUp = game.add.tween(this); tweenMoveUp.to( { y: this.y - WelcomePlayerText.MOVE_UP_AMOUNT_PX }, 1000, Phaser.Easing.Linear.None, true); tweenMoveUp.onComplete.addOnce(this.destroySelf, this); */ game.add.existing(this); }; destroySelf() { this.destroy(); } } WelcomePlayerText.DEFAULT_TEXT_FONT = { font: "40px Arial", boundsAlignH: "center", // left, center. right boundsAlignV: "middle", // top, middle, bottom fill: "#fff" }; WelcomePlayerText.FONT_HEIGHT_PX = 35;