Scripting: How do I show the selected tile image in the dialog?

I have a dialog created.
I have the selected tile (from the TilesetView) in a variable.
How do I show that tiles image in the dialog?
I don’t see any image property for the tile and I don’t see any getImageByID or something similar for the tileset.

1 Like

Tiles in Image Collections have imageFileName and regular Tilesets have image, both of these are file paths. You can open these with Image (e.g. let image = new Image(tileset.image);), and then cut out the part you need, e.g. let tileImage = image.copy(x, y, width, height). You can then display this in an image widget.

1 Like

Ok, thank you.
I was hoping that since there is already an image in memory somewhere I would just be able to grab it.
However this method should be easy enough.

2 Likes