Read a tile region
tiled_get_regionRetrieves a rectangular tile region from a Tiled map layer using tile coordinates and layer ID. Returns tile asset IDs or embedded references, with support for infinite maps and XML map raw GIDs.
Instructions
Returns a bounded rectangular tile region using tileset asset IDs and local tile IDs. Cells referencing an embedded (inline) tileset return a read-only {kind:"embedded", sourceIndex} reference instead of an asset ID. On infinite maps the rectangle uses absolute tile coordinates (negatives allowed) and cells outside every chunk are empty. XML maps (.tmx) return raw encoded GIDs (flip bits included) plus the map's tileset ranges so callers attribute cells by firstgid themselves; finite csv and base64 layers only — plain tile elements and chunks fail closed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| width | Yes | ||
| height | Yes | ||
| layerId | Yes | ||
| mapPath | Yes | Canonical project-relative POSIX path; absolute paths and .. are forbidden |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |