Place multiple tiles at once/ tile fill

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DoGot

Is it possible to massplace tiles? I need this for the floor of a hospital, i just need to place down the same tile for a large area

:bust_in_silhouette: Reply From: rakkarage

no specific api afaik but can just do somethibg like:

# fill rect with tile
func fillRect(rect: Rect2, id: int) -> void:
    for y in range(rect.position.y, rect.end.y)
        for x in range(rect.position.x, rect.end.x)
            set_cell(x, y, id)

# fill array of Vector2 with tile
func fillArrayy(aray: Array, id: int) -> void:
    for i in array:
        set_cellv(i, id)

Thank you for the help!

DoGot | 2020-07-14 19:41