LoadTiledMap

Category: Tiled Maps (Pro)

Back to System Functions


Signature

LoadTiledMap(fileName As String)

Returns

TiledMap

Description

Loads a Tiled map file and returns a TiledMap object with nested layers, objects, tilesets, and properties.

Use standard member and array access (for example: map.LayerCount, map.Layers[i], layer.Objects[j]).

Lifetime

When you are done with a loaded map, release it with Free map.

Do not free nested values like layers, objects, tilesets, or properties individually; they are owned by the parent map object and are released automatically when the map is freed.

Built-in Structures

See the dedicated type pages for full property grids:

Pro feature: compiling code that uses LoadTiledMap requires a license with the Tiled feature enabled.

Example


Dim map As TiledMap
Dim layer As TiledLayer

map = LoadTiledMap("assets/maps/level1.tmx")
If map <> Null Then
    DebugPrint "Layers: " + Str(map.LayerCount)
    If map.LayerCount > 0 Then
        layer = map.Layers[0]
        DebugPrint "First layer: " + layer.Name
    End If
    Free map
End If