mirror of https://github.com/lgc-4/DataTools3.git
17 lines
335 B
JavaScript
17 lines
335 B
JavaScript
class Camera {
|
|
static x = 0;
|
|
static y = 0;
|
|
static zoom = 1;
|
|
|
|
static setPosition(x, y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
Box.updateAllPositions();
|
|
|
|
document.getElementById("canvas").style.backgroundPosition = (-Camera.x) + "px " + (-Camera.y) + "px";
|
|
}
|
|
|
|
static movePosition(x, y) {
|
|
this.setPosition(this.x + x, this.y + y);
|
|
}
|
|
} |