Reformatted code #20

Merged
H4CK3R-01 merged 1 commits from reformatting into main 2021-06-11 05:59:36 +00:00
3 changed files with 11 additions and 11 deletions
Showing only changes of commit 065184bea8 - Show all commits

View File

@ -1,11 +1,11 @@
function isMobile() {
var mobileDeviceIndicator = 0;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
let mobileDeviceIndicator = 0;
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
mobileDeviceIndicator = 1;
}
/*
var hasTouchscreen = 'ontouchstart' in window;
alert(hasTouchscreen ? 'has touchscreen' : 'doesn\'t have touchscreen');*/
let hasTouchscreen = 'ontouchstart' in window;
alert(hasTouchscreen ? 'has touchscreen' : 'doesn\'t have touchscreen');
*/
}

View File

@ -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({
@ -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);
});
return this.graphics;
}
};
}

View File

@ -6,12 +6,12 @@ function Sprite(x, y) {
this.getSprite = function () {
this.setSize(this.sprite, sprite_size);
return this.sprite;
}
};
this.setSize = function (sprite, size) {
sprite.x = this.coord_x * size - size * 0.2;
sprite.y = this.coord_y * size - size * 0.2;
sprite.width = size * 1.5;
sprite.height = size * 1.5;
}
};
}