tmTilesetCreate

Category: Tilemap — Tilesets

Syntax:

tmTilesetCreate:Int(image:Int, tileW:Int, tileH:Int, padding:Int)


Parameters

Returns

The tileset's handle, or 0 if it can't be made.



Summary

Makes a tileset from an image, cutting it into tiles along a grid. Ids run from 1, left to right, then down. It turns smoothing off on the image so tiles can't bleed into each other. On the web, tiles draw once the image has arrived, and anything you set on the tileset before then is kept.

See the Tilemaps guide.



Example
tiles = tmTilesetCreate(b2dLoadImage("Media/tiles.png"), 16, 16, 0)

BambooBasic © 2026 Michael Denathorn