Fix: center message text color
This commit is contained in:
@@ -5,7 +5,7 @@ function CenterMessageText(contentText) {
|
||||
Phaser.Text.call(
|
||||
this, game,
|
||||
game.world.width / 2,
|
||||
game.world.height / 2, // - CenterMessageText.MOVE_AMOUNT_PX,
|
||||
game.world.height / 2 - CenterMessageText.MOVE_AMOUNT_PX,
|
||||
contentText,
|
||||
CenterMessageText.DEFAULT_TEXT_FONT
|
||||
);
|
||||
@@ -14,34 +14,41 @@ function CenterMessageText(contentText) {
|
||||
this.anchor.set(0.5);
|
||||
this.inputEnabled = false;
|
||||
|
||||
var grd = this.context.createLinearGradient(0, 0, 0, this.height);
|
||||
grd.addColorStop(0, "#FFFFFF"); // '#FFD68E');
|
||||
grd.addColorStop(1, "#FFD68E"); // '#B34C00');
|
||||
this.fill = grd;
|
||||
// var grd = this.context.createLinearGradient(0, 0, 0, this.height);
|
||||
// grd.addColorStop(0, CenterMessageText.COLOR_GRADATION_START); //'#FFD68E');
|
||||
// grd.addColorStop(1, CenterMessageText.COLOR_GRADATION_END); //'#B34C00');
|
||||
// this.fill = grd;
|
||||
this.fill = CenterMessageText.COLOR_TEXT;
|
||||
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
this.stroke = '#000';
|
||||
this.strokeThickness = 10;
|
||||
this.stroke = CenterMessageText.COLOR_STROKE;
|
||||
this.strokeThickness = 9;
|
||||
|
||||
|
||||
this.alpha = 0;
|
||||
this.alpha = 1;
|
||||
var tweenAlpha = game.add.tween(this);
|
||||
tweenAlpha.to( { alpha: 1 }, CenterMessageText.TWEEN_ALPHA_TIME, Phaser.Easing.Linear.None, true);
|
||||
tweenAlpha.to( { alpha: 0 }, CenterMessageText.TWEEN_ALPHA_TIME, Phaser.Easing.Elastic.In, true);
|
||||
tweenAlpha.onComplete.addOnce(this.destroy, this);
|
||||
|
||||
var tweenScale = game.add.tween(this.scale);
|
||||
tweenScale.to( { x: 0.8, y: 0.8 }, CenterMessageText.TWEEN_SCALE_TIME, Phaser.Easing.Bounce.Out, true);
|
||||
tweenScale.onComplete.addOnce(this.destroy, this);
|
||||
// var tweenScale = game.add.tween(this.scale);
|
||||
// tweenScale.to( { x: 0.8, y: 0.8 }, CenterMessageText.TWEEN_SCALE_TIME, Phaser.Easing.Bounce.Out, true);
|
||||
// tweenScale.onComplete.addOnce(this.destroy, this);
|
||||
|
||||
game.add.existing(this);
|
||||
};
|
||||
|
||||
|
||||
CenterMessageText.DEFAULT_TEXT_FONT = {
|
||||
font: "bold 100px Arial",
|
||||
font: "bold 40px Arial", // "bold 100px Arial",
|
||||
boundsAlignH: "center", // left, center. right
|
||||
boundsAlignV: "middle", // top, middle, bottom
|
||||
fill: "#fff"
|
||||
fill: CenterMessageText.COLOR_TEXT // "#fff"
|
||||
};
|
||||
|
||||
CenterMessageText.MOVE_AMOUNT_PX = 200;
|
||||
CenterMessageText.TWEEN_ALPHA_TIME = 1000;
|
||||
CenterMessageText.TWEEN_SCALE_TIME = 1500;
|
||||
CenterMessageText.MOVE_AMOUNT_PX = 100;
|
||||
CenterMessageText.TWEEN_ALPHA_TIME = 1500;
|
||||
CenterMessageText.TWEEN_SCALE_TIME = 1500;
|
||||
|
||||
CenterMessageText.COLOR_TEXT = "#ffcc00"; // "#cc9900";
|
||||
CenterMessageText.COLOR_GRADATION_START = "#B34C00"; // "#333333"; //"#666666";
|
||||
CenterMessageText.COLOR_GRADATION_END = "#333333"; // "#B34C00";
|
||||
CenterMessageText.COLOR_STROKE = "#663300"; //"#FFDD88"; //"#FFD68E";
|
||||
Reference in New Issue
Block a user