summaryrefslogtreecommitdiff
path: root/scripts/Utils/Grid.cs
blob: cde01f641bf8a753dada5280d0ef4ee1253a54c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
using Godot;
using System;

public abstract partial class Grid : GodotObject {
	public static readonly Vector2I tileSize = new(16, 16);

	public static Vector2I WorldToGrid(Vector2 coord) {
		return (Vector2I)(coord / tileSize);
	}

	public static Vector2 GridToWorld(Vector2I coord) {
		return coord * tileSize;
	}
}