27 lines
576 B
JavaScript
27 lines
576 B
JavaScript
/////////////////////////////
|
|
// How to play text
|
|
|
|
class HowToPlay {
|
|
|
|
constructor() {
|
|
this.howToPlayText = game.add.text(
|
|
game.world.centerX, game.world.centerY - HowToPlay.TEXT_OFFSET_X,
|
|
"", this.getFontStyle()
|
|
);
|
|
this.howToPlayText.anchor.set(0.5);
|
|
this.howToPlayText.stroke = "#333";
|
|
this.howToPlayText.strokeThickness = 3;
|
|
this.howToPlayText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
|
}
|
|
|
|
printHowToPlay(text) {
|
|
this.howToPlayText.text = text;
|
|
}
|
|
|
|
getFontStyle() {
|
|
return { font: "32px Arial", fill: "#fff" };
|
|
}
|
|
|
|
}
|
|
|
|
HowToPlay.TEXT_OFFSET_X = 200; |