Add: Chart, HowToPlay UI class
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/////////////////////////////
|
||||
// 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;
|
||||
Reference in New Issue
Block a user