class WelcomePlayerText extends Phaser.Text { constructor(playerName) { super(game, game.world.width / 2, game.world.height / 2 - 40, "어서오세요, " + 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; this.alpha = 1; let tweenAlpha = game.add.tween(this); tweenAlpha.to( { alpha: 0 }, 2000, Phaser.Easing.Back.In, true); game.add.existing(this); }; destroySelf() { this.destroy(); } } WelcomePlayerText.DEFAULT_TEXT_FONT = { font: "60px Arial", boundsAlignH: "center", // left, center. right boundsAlignV: "middle", // top, middle, bottom fill: "#fff" };