public Tileset(Tile[][] tiles, Texture tex)
        {
            this.tiles = tiles;
            this.tex = tex;

            Reload();
        }
 public static float[] getTextureVertices(Texture tex, Point p)
 {
     return getTextureVertices(p.X, p.Y, 0, tex.XTiles - 1, 0, tex.YTiles - 1, tex.OffsetX, tex.OffsetY);
 }
 public static int getTilesetY(int tileID, Texture tex)
 {
     return (tileID / tex.XTiles);
 }
 public static int getTilesetX(int tileID, Texture tex)
 {
     return tileID - (tex.XTiles * (tileID / tex.XTiles));
 }
 public static int getTilesetID(int x, int y, Texture tex)
 {
     return (y * tex.XTiles + x);
 }
        public static float[] getTextureVertices(Texture tex, int tileID)
        {
            int y = tileID / tex.XTiles;
            int x = tileID - (tex.XTiles * y);

            return getTextureVertices(x, y, 0, tex.XTiles - 1, 0, tex.YTiles - 1, tex.OffsetX, tex.OffsetY);
        }