tmMasksFromImage

Gives every tile a shape from its art: a pixel is solid if it's at least half opaque. Fully opaque tiles stay plain solid tiles. On the web it runs when the image arrives. It doesn't do anything useful on a Tiled image collection tileset. Takes tileset (The tileset's handle). Returns: How many tiles got a mask. On the web, 0 if the image is still on its way.

Tilemap

Parameters & Returns

Parameters

tileset Int

Returns

Int

Quick Summary

Gives every tile a shape from its art: a pixel is solid if it's at least half opaque. Fully opaque tiles stay plain solid tiles. On the web it runs when the image arrives. It doesn't do anything useful on a Tiled image collection tileset. Takes tileset (The tileset's handle). Returns: How many tiles got a mask. On the web, 0 if the image is still on its way.

Technical Exegesis...

Gives every tile a shape from its art: a pixel is solid if it's at least half opaque. Fully opaque tiles stay plain solid tiles. On the web it runs when the image arrives. It doesn't do anything useful on a Tiled image collection tileset.

See the Tilemaps guide.

Returns: How many tiles got a mask. On the web, 0 if the image is still on its way.

Example

Example.bam
tmMasksFromImage(tiles)