How to get the pattern drawn in the TileMap as an image?

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

Is it possible to get what I have drawn in the Tilemap as a single image?

Screenshot of a map I have drawn.

Your image wasn’t uploaded correctly. You can edit your first post and paste the URL to the image uploaded to a service such as Imgur.

Calinou | 2021-08-20 16:09

:bust_in_silhouette: Reply From: unkownzero

if you use a viewport as a parent of a tilemap you can use this code to save your tile as png

yield(VisualServer,"frame_post_draw")
var img2=get_viewport().get_texture().get_data()

img2.flip_y()
img2.convert(Image.FORMAT_ETC2_RGBA8)
img2.save_png("vp2.png")

Thanks! I happened to find another way for what a had in mind. I might use your suggestion if it happens to be more effective in terms of performance.

mateushm | 2021-08-21 20:43