Buttons work now on mobile devices
This commit is contained in:
parent
0680930f78
commit
997e7a0f89
@ -9,7 +9,7 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t
|
|||||||
this.text = text;
|
this.text = text;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.button_is_answer = button_is_answer;
|
this.button_is_answer = button_is_answer;
|
||||||
this.click = click;
|
this.pointerdown = click;
|
||||||
this.selected = false;
|
this.selected = false;
|
||||||
let _this = this;
|
let _this = this;
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t
|
|||||||
this.graphics.interactive = true;
|
this.graphics.interactive = true;
|
||||||
this.graphics.buttonMode = true;
|
this.graphics.buttonMode = true;
|
||||||
this.graphics.defaultCursor = 'pointer';
|
this.graphics.defaultCursor = 'pointer';
|
||||||
this.graphics.on('click', function () {
|
this.graphics.on('pointerdown', function () {
|
||||||
if (_this.button_is_answer) {
|
if (_this.button_is_answer) {
|
||||||
if (_this.selected === true) {
|
if (_this.selected === true) {
|
||||||
_this.unSelectButton();
|
_this.unSelectButton();
|
||||||
|
@ -126,7 +126,7 @@ function start_game() {
|
|||||||
dice.interactive = true;
|
dice.interactive = true;
|
||||||
dice.buttonMode = true;
|
dice.buttonMode = true;
|
||||||
dice.defaultCursor = 'pointer';
|
dice.defaultCursor = 'pointer';
|
||||||
dice.on('click', function () {
|
dice.on('pointerdown', function () {
|
||||||
if (!diced) {
|
if (!diced) {
|
||||||
socket.emit('roll dice');
|
socket.emit('roll dice');
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ function generate_card_stack(sprite, x, y, onclick) {
|
|||||||
sprite.interactive = true;
|
sprite.interactive = true;
|
||||||
sprite.buttonMode = true;
|
sprite.buttonMode = true;
|
||||||
sprite.defaultCursor = 'pointer';
|
sprite.defaultCursor = 'pointer';
|
||||||
sprite.on('click', onclick);
|
sprite.on('pointerdown', onclick);
|
||||||
return sprite;
|
return sprite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user