-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Tilemaps | ||
|
||
| ||
|
||
## `SnapBufferWriteTilemap` | ||
|
||
*Returns:* N/A (`undefined`) | ||
|
||
|Name |Datatype|Purpose | | ||
|---------|--------|-----------------------------| | ||
|`buffer` |buffer |Buffer to write the data into| | ||
|`tilemap`|tilemap |Tilemap to serialize | | ||
|
||
Stores the contents of a tilemap in a buffer, starting at the buffer's current head position. | ||
|
||
!> The name of the tileset to use is embedded in the tilemap data so any renamed or deleted tilesets will fail to read. | ||
|
||
| ||
|
||
## `SnapBufferReadTilemapNew` | ||
|
||
*Returns:* N/A (`undefined`) | ||
|
||
|Name |Datatype|Purpose | | ||
|--------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------| | ||
|`buffer`|buffer |Buffer to write the data into | | ||
|`offset`|integer |The position in the buffer to read the tilemap from, relative to the start of the buffer. If set to `undefined`, the buffer's head position is used| | ||
|`layer` |string |Name of room layer to create the tilemap on | | ||
|
||
Creates a new tilemap on the given layer. The tilemap's dimensions and position will be set to whatever is in the data found in the buffer. | ||
|
||
!> The name of the tileset to use is embedded in the tilemap data (see above) so any renamed or deleted tilesets will fail to read. | ||
|
||
| ||
|
||
## `SnapBufferReadTilemapOverwrite` | ||
|
||
*Returns:* N/A (`undefined`) | ||
|
||
|Name |Datatype|Purpose | | ||
|----------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------| | ||
|`buffer` |buffer |Buffer to write the data into | | ||
|`offset` |integer |The position in the buffer to read the tilemap from, relative to the start of the buffer. If set to `undefined`, the buffer's head position is used| | ||
|`tilemap` |tilemap |Tilemap whose contents this function should overwrite | | ||
|`[readPosition]`|boolean |Whether to set the position of the tilemap based on the coordinates in the tilemap data. Defaults to `false` if not specified | | ||
|
||
Overwrites the contents of an already existing tilemap based on data serialized by `SnapBufferWriteTilemap()`. If the width or height of the incoming tilemap is larger than the current tilemap, extra tiles will not be created. If the width or height is smaller than the current tilemap, the empty space will be set to `0` (no tile). | ||
|
||
!> The name of the tileset to use is embedded in the tilemap data (see above) so any renamed or deleted tilesets will fail to read. |