commit
f1d053bf29
@ -1,11 +1,11 @@
|
|||||||
function isMobile() {
|
function isMobile() {
|
||||||
|
let mobileDeviceIndicator = 0;
|
||||||
var mobileDeviceIndicator = 0;
|
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
||||||
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
|
|
||||||
mobileDeviceIndicator = 1;
|
mobileDeviceIndicator = 1;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
var hasTouchscreen = 'ontouchstart' in window;
|
let hasTouchscreen = 'ontouchstart' in window;
|
||||||
alert(hasTouchscreen ? 'has touchscreen' : 'doesn\'t have touchscreen');*/
|
alert(hasTouchscreen ? 'has touchscreen' : 'doesn\'t have touchscreen');
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,17 +20,17 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t
|
|||||||
this.graphics.beginFill(color);
|
this.graphics.beginFill(color);
|
||||||
this.graphics.drawRect(this.x, this.y, this.width, this.height);
|
this.graphics.drawRect(this.x, this.y, this.width, this.height);
|
||||||
this.graphics.endFill();
|
this.graphics.endFill();
|
||||||
}
|
};
|
||||||
|
|
||||||
this.selectButton = function () {
|
this.selectButton = function () {
|
||||||
this.selected = true;
|
this.selected = true;
|
||||||
this.changeButtonColor(select_color);
|
this.changeButtonColor(select_color);
|
||||||
}
|
};
|
||||||
|
|
||||||
this.unSelectButton = function () {
|
this.unSelectButton = function () {
|
||||||
this.selected = false;
|
this.selected = false;
|
||||||
this.changeButtonColor(default_color);
|
this.changeButtonColor(default_color);
|
||||||
}
|
};
|
||||||
|
|
||||||
this.getButton = function () {
|
this.getButton = function () {
|
||||||
const style = new PIXI.TextStyle({
|
const style = new PIXI.TextStyle({
|
||||||
@ -74,5 +74,5 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t
|
|||||||
if (!_this.selected) _this.changeButtonColor(_this.default_color);
|
if (!_this.selected) _this.changeButtonColor(_this.default_color);
|
||||||
});
|
});
|
||||||
return this.graphics;
|
return this.graphics;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ function Sprite(x, y) {
|
|||||||
this.getSprite = function () {
|
this.getSprite = function () {
|
||||||
this.setSize(this.sprite, sprite_size);
|
this.setSize(this.sprite, sprite_size);
|
||||||
return this.sprite;
|
return this.sprite;
|
||||||
}
|
};
|
||||||
|
|
||||||
this.setSize = function (sprite, size) {
|
this.setSize = function (sprite, size) {
|
||||||
sprite.x = this.coord_x * size - size * 0.2;
|
sprite.x = this.coord_x * size - size * 0.2;
|
||||||
sprite.y = this.coord_y * size - size * 0.2;
|
sprite.y = this.coord_y * size - size * 0.2;
|
||||||
sprite.width = size * 1.5;
|
sprite.width = size * 1.5;
|
||||||
sprite.height = size * 1.5;
|
sprite.height = size * 1.5;
|
||||||
}
|
};
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user