Tilemap Documentation
Tilemap Methods
beep8.Tilemap.createEmptyTilemap(width, height)
Create an empty tilemap array of the specified size.
Parameters
- width (number): The width of the tilemap.
- height (number): The height of the tilemap.
Returns
- (Array): The empty tilemap array.
beep8.Tilemap.draw(tilemap [,width] [,height])
Draw a tilemap array to the screen.
Parameters
- tilemap (Array): The tilemap array to draw.
- [width] (number): The width of the tilemap to draw. (default: null)
- [height] (number): The height of the tilemap to draw. (default: null)
beep8.Tilemap.getDefaultTile()
Get the default tile for a tilemap.
Returns
- (Array): The default tile.
beep8.Tilemap.load(data)
Load a tilemap array from a string.
Parameters
- data (string): The encoded string
Returns
- (Array): The tilemap array
beep8.Tilemap.save(tilemap)
Convert a tilemap array to a string.
This string can be loaded with beep8.Tilemap.load.
Parameters
- tilemap (Array): The tilemap array to save.
Returns
- (string): The encoded string