godotengine / godotengine/godot-docs

Improve documentation for tilemaps with atlas textures

Open
#4,509 0 comments 0 reactions 0 assignees View on GitHub
area:class reference enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**
V3.2.4 Beta 4

**Issue description:**
I wanted to find out the tile ID at a specific position in a TileMap with atlas texture. After getting "0" for all positions and not finding any hint in the documentation, I eventually found [this forum thread](https://godotforums.org/discussion/23571/how-to-find-the-tile-id-of-a-tile-the-player-is-currently-colliding-with) with the solution:

> Are you using atlas texture? in that case, the get_cellv doesn't work, but you can get tile coordinates with:
> tilemap.get_cell_autotile_coord(x, y) ... yes, it says autotile in the name, but works for atlases too.

So I would propose two changes to the documentation:

1) In https://docs.godotengine.org/en/stable/classes/class_tilemap.html#class-tilemap-method-get-cellv add _"Will return the ID of the main tile for all subtiles in an atlas texture. Use get_cell_autotile_coord() instead to identify subtiles of atlas textures."_

2) In https://docs.godotengine.org/en/stable/classes/class_tilemap.html#class-tilemap-method-get-cell-autotile-coord add _"Also works for identifying atlas texture subtiles."_

**URL to the documentation page (if already existing):**
https://docs.godotengine.org/en/stable/classes/class_tilemap.html

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.