Skip to content

Commit 1316353

Browse files
authored
docs: GID code example tweaks (#3807)
Updated the example C++ code to use "get_tile" as the hypothetical method to get a tile based on its ID instead of "tileAt", for two reasons: 1. The rest of the code uses snake_case, but this one used camelCase for some reason. 2. "tileAt" sounds like it implies that the ID is a location/index. This is misleading, since in Tiled tilesets, the ids are not necessarily positions or indices - tiles may be stored out of order, and the IDs may not even be sequential. I think "get tile" avoids such implications.
1 parent 729d001 commit 1316353

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/reference/global-tile-ids.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ clear, it deals with flags and deduces the appropriate tileset:
133133
Tileset *tileset = tilesets[i];
134134
135135
if (tileset->first_gid() <= global_tile_id) {
136-
tiles[y][x] = tileset->tileAt(global_tile_id - tileset->first_gid());
136+
tiles[y][x] = tileset->get_tile(global_tile_id - tileset->first_gid());
137137
break;
138138
}
139139
}

0 commit comments

Comments
 (0)