pixelToTileCoords(x, y, v) {
		const ret = v || new Vector2d();

		if (this.staggerX) {
			//flat top
			x -= this.staggerEven ? this.tilewidth : this.sideoffsetx;
		} else {
			//pointy top
			y -= this.staggerEven ? this.tileheight : this.sideoffsety;
		}

		// Start with the coordinates of a grid-aligned tile
		const referencePoint = vector2dPool.get(
			Math.floor(x / (this.columnwidth * 2)),
			Math.floor(y / (this.rowheight * 2)),
		);

		// Relative x and y position on the base square of the grid-aligned tile
		const rel = vector2dPool.get(
			x - referencePoint.x * (this.columnwidth * 2),
			y - referencePoint.y * (this.rowheight * 2),
		);

		// Adjust the reference point to the correct tile coordinates
		if (this.staggerX) {
			referencePoint.x = referencePoint.x * 2;
			if (this.staggerEven) {
				++referencePoint.x;
			}
		} else {
			referencePoint.y = referencePoint.y * 2;
			if (this.staggerEven) {
				++referencePoint.y;
			}
		}

		// Determine the nearest hexagon tile by the distance to the center
		let left;
		let top;
		let centerX;
		let centerY;
		if (this.staggerX) {
			left = this.sidelengthx / 2;
			centerX = left + this.columnwidth;
			centerY = this.tileheight / 2;

			this.centers[0].set(left, centerY);
			this.centers[1].set(centerX, centerY - this.rowheight);
			this.centers[2].set(centerX, centerY + this.rowheight);
			this.centers[3].set(centerX + this.columnwidth, centerY);
		} else {
			top = this.sidelengthy / 2;
			centerX = this.tilewidth / 2;
			centerY = top + this.rowheight;

			this.centers[0].set(centerX, top);
			this.centers[1].set(centerX - this.columnwidth, centerY);
			this.centers[2].set(centerX + this.columnwidth, centerY);
			this.centers[3].set(centerX, centerY + this.rowheight);
		}

		let nearest = 0;
		let minDist = Number.MAX_VALUE;
		for (let i = 0; i < 4; ++i) {
			const dc = this.centers[i].sub(rel).length2();
			if (dc < minDist) {
				minDist = dc;
				nearest = i;
			}
		}

		const offsets = this.staggerX ? offsetsStaggerX : offsetsStaggerY;

		ret.set(
			referencePoint.x + offsets[nearest].x,
			referencePoint.y + offsets[nearest].y,
		);

		vector2dPool.release(referencePoint);
		vector2dPool.release(rel);

		return ret;
	}
return the tile position corresponding to the specified pixel
@ignore