From 9fbceb79eb19649a0b1e44937852f5336f2b5225 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 13 Feb 2025 00:10:10 +0800 Subject: [PATCH] Document the valid range of tile coordinates in TileMapLayer --- doc/classes/TileMap.xml | 1 + doc/classes/TileMapLayer.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index f347c9a08ff..6cddf7d9703 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -7,6 +7,7 @@ Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles which are used to create grid-based maps. A TileMap may have several layers, layouting tiles on top of each other. For performance reasons, all TileMap updates are batched at the end of a frame. Notably, this means that scene tiles from a [TileSetScenesCollectionSource] may be initialized after their parent. This is only queued when inside the scene tree. To force an update earlier on, call [method update_internals]. + [b]Note:[/b] For performance and compatibility reasons, the coordinates serialized by [TileMap] are limited to 16-bit signed integers, i.e. the range for X and Y coordinates is from [code]-32768[/code] to [code]32767[/code]. When saving tile data, tiles outside this range are wrapped. $DOCS_URL/tutorials/2d/using_tilemaps.html diff --git a/doc/classes/TileMapLayer.xml b/doc/classes/TileMapLayer.xml index b17d3899ef3..e7f0a3d9974 100644 --- a/doc/classes/TileMapLayer.xml +++ b/doc/classes/TileMapLayer.xml @@ -7,6 +7,7 @@ Node for 2D tile-based maps. A [TileMapLayer] uses a [TileSet] which contain a list of tiles which are used to create grid-based maps. Unlike the [TileMap] node, which is deprecated, [TileMapLayer] has only one layer of tiles. You can use several [TileMapLayer] to achieve the same result as a [TileMap] node. For performance reasons, all TileMap updates are batched at the end of a frame. Notably, this means that scene tiles from a [TileSetScenesCollectionSource] may be initialized after their parent. This is only queued when inside the scene tree. To force an update earlier on, call [method update_internals]. + [b]Note:[/b] For performance and compatibility reasons, the coordinates serialized by [TileMapLayer] are limited to 16-bit signed integers, i.e. the range for X and Y coordinates is from [code]-32768[/code] to [code]32767[/code]. When saving tile data, tiles outside this range are wrapped. $DOCS_URL/tutorials/2d/using_tilemaps.html