Skip to content

DaiconMapLayer

daicon_map_layer.png

Represents a single local independent node TileMapLayer with an embedded core DaiconMap.

A DaiconMapLayer is thus a support node or a node representing an individual element of your environment that requires special attention.


Parameters:

- grid_map

Array[Node]

DaiconMap Core.


- mesh_library

MeshLibrary

Library of meshes from which the 3D environment is built.


- physics_material

PhysicsMaterial

Used to determine the physical properties, such as friction and elasticity, of individual tiles.


- size

Vector3

The size of one three-dimensional tile in meters.


- layer

int

Collision layers for grid_map.


- mask

int

Collision layers for grid_map.


- bake_navigation

bool

Bake a navigation grid for 3D.


Methods:

- _ready

Deploys the kernel at each startup. Performs basic configuration of the node.


- _process

Works only in the editor.

Updates grid_map when the number of 3D tiles is not equal to the number of 2D tiles (calls update_grid_map).

Synchronizes moving of node in 2D and its core in 3D.


- update_grid_map

Updates grid_map.

func update_grid_map():
    grid_map.clear()
    for tile in get_used_cells():
        var tile_data = get_cell_tile_data(Vector2(tile.x, tile.y))
        grid_map.set_cell_item(Vector3(tile.x, z_index-1, tile.y+z_index), tile_data.get_custom_data("Item"))