Files
chocomae/src/game/lib/text/mission_clear_text.js
T

46 lines
1.3 KiB
JavaScript

MissionClearText.prototype = Object.create(Phaser.Text.prototype);
MissionClearText.constructor = MissionClearText;
function MissionClearText() {
Phaser.Text.call(
this, game,
game.world.width / 2,
game.world.height / 2 - MissionClearText.MOVE_AMOUNT_PX,
"작업 완료",
MissionClearText.DEFAULT_TEXT_FONT
);
// super(game, 600, 300, "게임 오버", MissionClearText.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 = 10;
this.alpha = 0;
var tweenAlpha = game.add.tween(this);
tweenAlpha.to( { alpha: 1 }, MissionClearText.TWEEN_ALPHA_TIME, Phaser.Easing.Linear.None, true);
var tweenMove = game.add.tween(this);
tweenMove.to( { y: game.world.height / 2 }, MissionClearText.TWEEN_MOVE_TIME, Phaser.Easing.Bounce.Out, true);
game.add.existing(this);
};
MissionClearText.DEFAULT_TEXT_FONT = {
font: "bold 100px Arial",
boundsAlignH: "center", // left, center. right
boundsAlignV: "middle", // top, middle, bottom
fill: "#fff"
};
MissionClearText.MOVE_AMOUNT_PX = 200;
MissionClearText.TWEEN_ALPHA_TIME = 1000;
MissionClearText.TWEEN_MOVE_TIME = 1500;