Fix: ES6 -> ES5 (imcompleted)
This commit is contained in:
@@ -1,30 +1,34 @@
|
||||
class WelcomePlayerText extends Phaser.Text {
|
||||
WelcomePlayerText.prototype = Object.create(Phaser.Text.prototype);
|
||||
WelcomePlayerText.constructor = WelcomePlayerText;
|
||||
|
||||
constructor(playerName) {
|
||||
super(game, game.world.width / 2, game.world.height / 2 - 40, "어서오세요, " + playerName + "님", WelcomePlayerText.DEFAULT_TEXT_FONT);
|
||||
function WelcomePlayerText(playerName) {
|
||||
Phaser.Text.call(
|
||||
this, game,
|
||||
game.world.width / 2, game.world.height / 2 - 40,
|
||||
"어서오세요, " + playerName + "님",
|
||||
WelcomePlayerText.DEFAULT_TEXT_FONT
|
||||
);
|
||||
|
||||
this.anchor.set(0.5);
|
||||
this.inputEnabled = false;
|
||||
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;
|
||||
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);
|
||||
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();
|
||||
}
|
||||
game.add.existing(this);
|
||||
}
|
||||
|
||||
WelcomePlayerText.prototype.destroySelf = function() {
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
WelcomePlayerText.DEFAULT_TEXT_FONT = {
|
||||
@@ -32,4 +36,4 @@ WelcomePlayerText.DEFAULT_TEXT_FONT = {
|
||||
boundsAlignH: "center", // left, center. right
|
||||
boundsAlignV: "middle", // top, middle, bottom
|
||||
fill: "#fff"
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user