Merge branch 'main' into multiplayer
This commit is contained in:
@@ -9,7 +9,7 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t
|
||||
this.text = text;
|
||||
this.status = status;
|
||||
this.button_is_answer = button_is_answer;
|
||||
this.click = click;
|
||||
this.pointerdown = click;
|
||||
this.selected = false;
|
||||
let _this = this;
|
||||
|
||||
@@ -20,17 +20,17 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t
|
||||
this.graphics.beginFill(color);
|
||||
this.graphics.drawRect(this.x, this.y, this.width, this.height);
|
||||
this.graphics.endFill();
|
||||
}
|
||||
};
|
||||
|
||||
this.selectButton = function () {
|
||||
this.selected = true;
|
||||
this.changeButtonColor(select_color);
|
||||
}
|
||||
};
|
||||
|
||||
this.unSelectButton = function () {
|
||||
this.selected = false;
|
||||
this.changeButtonColor(default_color);
|
||||
}
|
||||
};
|
||||
|
||||
this.getButton = function () {
|
||||
const style = new PIXI.TextStyle({
|
||||
@@ -55,7 +55,7 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t
|
||||
this.graphics.interactive = true;
|
||||
this.graphics.buttonMode = true;
|
||||
this.graphics.defaultCursor = 'pointer';
|
||||
this.graphics.on('click', function () {
|
||||
this.graphics.on('pointerdown', function () {
|
||||
click();
|
||||
});
|
||||
this.graphics.on('mouseover', function () {
|
||||
@@ -67,5 +67,5 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t
|
||||
if (!_this.selected) _this.changeButtonColor(_this.default_color);
|
||||
});
|
||||
return this.graphics;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user