ViewFrame.initInfobox = function (ibox, iboxSlots) {
-
+ // TODO: make faster
ViewFrame.chunks
.chunkMetadataNames.forEach((item, i) => {
const slot = document.createElement('tr');
this.southChunk = Math.floor(this.south);
};
+/**
+* dx and dy are the distances in chunks
+*/
ViewFrame.prototype.moveCenter = function (dx, dy) {
// to pan when we click on the map!
this.x += (dx - this.width / 2) / this.zoom;
this.y += (dy - this.height / 2) / this.zoom;
};
+
+/**
+* x and y are positions in chunks
+*/
ViewFrame.prototype.setCenter = function (x, y) {
this.x = x;
this.y = y;
};
+/**
+* x and y are positions in BLOCKS!!!!
+*/
+ViewFrame.prototype.setBlockwiseCenter = function (x, y) {
+ this.x = x / this.zoom;
+ this.y = y / this.zoom;
+};
+
ViewFrame.prototype.clear = function () {
this.loadedChunksByName.clear();
this.loadedChunksByCoords.clear();