Skip to content

getPropertyArray

getPropertyArray<T>(obj, name): T[]

Defined in: tilemap/src/properties.ts:26

Get a pseudo-array of property values.

Tiled doesn’t support array properties natively, so a common convention is to use indexed names like spawns[0], spawns[1], etc. This function collects them into a proper array, preserving index order.

The indices must run from 0 without gaps. A gap means a property was renamed or deleted in Tiled, which would otherwise hand back an array with undefined holes typed as values, so it throws naming the missing index.

T = unknown

HasProperties

string

T[]

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/tilemap.md.