Fix: remove game argument for ScreenBottom constructor

This commit is contained in:
2018-05-16 10:26:40 +09:00
parent 3ed621d9f3
commit c307c69d8b
5 changed files with 14 additions and 24 deletions
+6 -8
View File
@@ -3,19 +3,17 @@
class ScreenBottom {
constructor(game) {
this.game = game;
constructor() {
this.BOTTOM_BAR_HEIGHT = 50;
this.BOTTOM_BAR_NAME_WIDTH = 200;
this.BOTTOM_BAR_TEXT_OFFSET = 10;
this.bottomAreaPositionY = this.game.world.height - this.BOTTOM_BAR_HEIGHT;
this.bottomAreaPositionY = game.world.height - this.BOTTOM_BAR_HEIGHT;
let style = { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "left", boundsAlignV: "bottom" };
let posX = this.BOTTOM_BAR_TEXT_OFFSET;
this.leftText = this.game.add.text(posX, this.bottomAreaPositionY, "", style)
this.leftText = game.add.text(posX, this.bottomAreaPositionY, "", style)
.setTextBounds(0, 0, this.BOTTOM_BAR_NAME_WIDTH, this.BOTTOM_BAR_HEIGHT)
.addColor('#ffffff', 0);
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
@@ -24,7 +22,7 @@ class ScreenBottom {
style.align = "center";
style.boundsAlignH = "center";
posX = game.world.width / 2 - this.BOTTOM_BAR_NAME_OFFSET_RIGHT;
this.centerText = this.game.add.text(0, this.bottomAreaPositionY, "", style)
this.centerText = game.add.text(0, this.bottomAreaPositionY, "", style)
.setTextBounds(0, 0, game.world.width, this.BOTTOM_BAR_HEIGHT)
.addColor('#ffffff', 0);
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
@@ -34,14 +32,14 @@ class ScreenBottom {
style.align = "right";
style.boundsAlignH = "right";
posX = game.world.width - this.BOTTOM_BAR_NAME_WIDTH - this.BOTTOM_BAR_TEXT_OFFSET;
this.rightText = this.game.add.text(posX, this.bottomAreaPositionY, "", style)
this.rightText = game.add.text(posX, this.bottomAreaPositionY, "", style)
.setTextBounds(0, 0, this.BOTTOM_BAR_NAME_WIDTH, this.BOTTOM_BAR_HEIGHT)
.addColor('#ffffff', 0);
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
}
makeBottomLine() {
this.game.add.graphics()
game.add.graphics()
.beginFill(0xffffff, 0.1)
.drawRect(0, this.bottomAreaPositionY, game.world.width, this.BOTTOM_BAR_HEIGHT);