Familiar territory. Tilemap keeps the RPG Maker MZ API, so existing MZ knowledge, tutorials and plugin code apply. Reactor's additions are marked with descriptions below.
The tilemap which displays 2D tile-based game map.
function Tilemap()
Quick Reference
Setup & Creation 4
| initialize() | Sets up a new instance. |
| _prepareV8Frame() | Prepare v8 frame. |
| _createLayers() | Creates the layers. |
| makeAutotileId() | Makes the autotile id. |
Getting Information 2
| getAutotileKind() | Gets the autotile kind. |
| getAutotileShape() | Gets the autotile shape. |
Checks (True / False) 23
| isReady() | Checks whether the tileset is ready to render. |
| _isHigherTile() | Whether it is higher tile. |
| _isTableTile() | Whether it is table tile. |
| _isOverpassPosition() | Whether it is overpass position. |
| isVisibleTile() | Whether it is visible tile. |
| isAutotile() | Whether it is autotile. |
| isSameKindTile() | Whether it is same kind tile. |
| isTileA1() | Whether it is tile a1. |
| isTileA2() | Whether it is tile a2. |
| isTileA3() | Whether it is tile a3. |
| isTileA4() | Whether it is tile a4. |
| isTileA5() | Whether it is tile a5. |
| isWaterTile() | Whether it is water tile. |
| isWaterfallTile() | Whether it is waterfall tile. |
| isGroundTile() | Whether it is ground tile. |
| isShadowingTile() | Whether it is shadowing tile. |
| isRoofTile() | Whether it is roof tile. |
| isWallTopTile() | Whether it is wall top tile. |
| isWallSideTile() | Whether it is wall side tile. |
| isWallTile() | Whether it is wall tile. |
| isFloorTypeAutotile() | Whether it is floor type autotile. |
| isWallTypeAutotile() | Whether it is wall type autotile. |
| isWaterfallTypeAutotile() | Whether it is waterfall type autotile. |
Actions 12
| destroy() | Destroys the tilemap. |
| setData() | Sets the tilemap data. |
| setBitmaps() | Sets the bitmaps used as a tileset. |
| _addAllSpots() | Adds the all spots. |
| _addSpot() | Adds the spot. |
| _addSpotTile() | Adds the spot tile. |
| _addTile() | Adds the tile. |
| setTileAnimation() | Tile animation a tileset sets out (an RPG Maker 2000/2003 import): frames maps a tile id to the ids it shows… |
| _addNormalTile() | Adds the normal tile. |
| _addAutotile() | Adds the autotile. |
| _addTableEdge() | Adds the table edge. |
| _addShadow() | Adds the shadow. |
Updating & Drawing 6
| update() | Updates the tilemap for each frame. |
| _syncV8TileLayers() | Sync v8 tile layers. |
| refresh() | Forces to repaint the entire tilemap. |
| updateTransform() | Updates the transform on all children of this container for rendering. |
| _updateBitmaps() | Updates the bitmaps each frame. |
| Renderer() | Renderer. |
Other 23
| _rrChunksSkipped() | Rr chunks skipped. |
| CombinedLayer() | Combined layer. |
| _rrChunkBlocker() | Why this frame keeps the full paint, or null when it paints in chunks. |
| ChunkRecorder() | Collects one chunk's rects as the painting hooks hand them to a layer, with the water motion _addAutotile mar… |
| _rrEnterChunks() | Rr enter chunks. |
| _rrLeaveChunks() | Rr leave chunks. |
| _rrDestroyChunkPart() | Rr destroy chunk part. |
| _rrResetChunks() | Every block goes back to the pool: the tileset, the map or its flags changed, or refresh() was called. |
| _rrChunksStale() | Rr chunks stale. |
| _rrChunkKey() | Rr chunk key. |
| _rrPaintChunks() | Paints this frame in chunks; false (after handing back to the full paint) when that fails. |
| _rrShowChunk() | Rr show chunk. |
| _rrReleaseChunk() | Rr release chunk. |
| _rrBuildChunk() | Paints one block through the painting hooks, into recorders standing in for the canonical layers, at water fr… |
| _rrChunkPart() | One layer's mesh of a block, from its recorder: reuses the part it had or a pooled one. |
| _rrAnimateChunk() | The water frame on a block's animated quads: water slides along x, falls along y. |
| _rrChunkSnapshot() | The map data a block was painted from: layers 0-4 of its tiles and of the row above (table edges). |
| _rrChunkChanged() | Rr chunk changed. |
| _rrKeepUsedTileFrames() | The animated tiles the map shows now. |
| _readMapData() | Read map data. |
| _sortChildren() | Sort children. |
| _compareChildOrder() | Compare child order. |
| Layer() | Layer. |
Setup & Creation
initialize
method sourceTilemap.prototype.initialize()
Sets up a new instance. (Same as the RPG Maker MZ method of this name.)
_prepareV8Frame
method internal sourceTilemap.prototype._prepareV8Frame()
Prepare v8 frame. (Same as the RPG Maker MZ method of this name.)
_createLayers
method internal sourceTilemap.prototype._createLayers()
Creates the layers. (Same as the RPG Maker MZ method of this name.)
makeAutotileId
static sourceTilemap.makeAutotileId(kind, shape)
Makes the autotile id. (Same as the RPG Maker MZ method of this name.)
Getting Information
getAutotileKind
static sourceTilemap.getAutotileKind(tileId)
Gets the autotile kind. (Same as the RPG Maker MZ method of this name.)
getAutotileShape
static sourceTilemap.getAutotileShape(tileId)
Gets the autotile shape. (Same as the RPG Maker MZ method of this name.)
Checks (True / False)
isReady
method sourceTilemap.prototype.isReady()
Checks whether the tileset is ready to render.
Details
Checks whether the tileset is ready to render.
_isHigherTile
method internal sourceTilemap.prototype._isHigherTile(tileId)
Whether it is higher tile. (Same as the RPG Maker MZ method of this name.)
_isTableTile
method internal sourceTilemap.prototype._isTableTile(tileId)
Whether it is table tile. (Same as the RPG Maker MZ method of this name.)
_isOverpassPosition
method internal sourceTilemap.prototype._isOverpassPosition(/*mx, my*/)
Whether it is overpass position. (Same as the RPG Maker MZ method of this name.)
isVisibleTile
static sourceTilemap.isVisibleTile(tileId)
Whether it is visible tile. (Same as the RPG Maker MZ method of this name.)
isAutotile
static sourceTilemap.isAutotile(tileId)
Whether it is autotile. (Same as the RPG Maker MZ method of this name.)
isSameKindTile
static sourceTilemap.isSameKindTile(tileID1, tileID2)
Whether it is same kind tile. (Same as the RPG Maker MZ method of this name.)
isTileA1
static sourceTilemap.isTileA1(tileId)
Whether it is tile a1. (Same as the RPG Maker MZ method of this name.)
isTileA2
static sourceTilemap.isTileA2(tileId)
Whether it is tile a2. (Same as the RPG Maker MZ method of this name.)
isTileA3
static sourceTilemap.isTileA3(tileId)
Whether it is tile a3. (Same as the RPG Maker MZ method of this name.)
isTileA4
static sourceTilemap.isTileA4(tileId)
Whether it is tile a4. (Same as the RPG Maker MZ method of this name.)
isTileA5
static sourceTilemap.isTileA5(tileId)
Whether it is tile a5. (Same as the RPG Maker MZ method of this name.)
isWaterTile
static sourceTilemap.isWaterTile(tileId)
Whether it is water tile. (Same as the RPG Maker MZ method of this name.)
isWaterfallTile
static sourceTilemap.isWaterfallTile(tileId)
Whether it is waterfall tile. (Same as the RPG Maker MZ method of this name.)
isGroundTile
static sourceTilemap.isGroundTile(tileId)
Whether it is ground tile. (Same as the RPG Maker MZ method of this name.)
isShadowingTile
static sourceTilemap.isShadowingTile(tileId)
Whether it is shadowing tile. (Same as the RPG Maker MZ method of this name.)
isRoofTile
static sourceTilemap.isRoofTile(tileId)
Whether it is roof tile. (Same as the RPG Maker MZ method of this name.)
isWallTopTile
static sourceTilemap.isWallTopTile(tileId)
Whether it is wall top tile. (Same as the RPG Maker MZ method of this name.)
isWallSideTile
static sourceTilemap.isWallSideTile(tileId)
Whether it is wall side tile. (Same as the RPG Maker MZ method of this name.)
isWallTile
static sourceTilemap.isWallTile(tileId)
Whether it is wall tile. (Same as the RPG Maker MZ method of this name.)
isFloorTypeAutotile
static sourceTilemap.isFloorTypeAutotile(tileId)
Whether it is floor type autotile. (Same as the RPG Maker MZ method of this name.)
isWallTypeAutotile
static sourceTilemap.isWallTypeAutotile(tileId)
Whether it is wall type autotile. (Same as the RPG Maker MZ method of this name.)
isWaterfallTypeAutotile
static sourceTilemap.isWaterfallTypeAutotile(tileId)
Whether it is waterfall type autotile. (Same as the RPG Maker MZ method of this name.)
Actions
destroy
method sourceTilemap.prototype.destroy()
Destroys the tilemap.
setData
method sourceTilemap.prototype.setData(width, height, data)
Sets the tilemap data.
Details
Sets the tilemap data.
setBitmaps
method sourceTilemap.prototype.setBitmaps(bitmaps)
Sets the bitmaps used as a tileset.
Details
Sets the bitmaps used as a tileset.
_addAllSpots
method internal sourceTilemap.prototype._addAllSpots(startX, startY)
Adds the all spots. (Same as the RPG Maker MZ method of this name.)
_addSpot
method internal sourceTilemap.prototype._addSpot(startX, startY, x, y)
Adds the spot. (Same as the RPG Maker MZ method of this name.)
_addSpotTile
method internal sourceTilemap.prototype._addSpotTile(tileId, dx, dy)
Adds the spot tile. (Same as the RPG Maker MZ method of this name.)
_addTile
method internal sourceTilemap.prototype._addTile(layer, tileId, dx, dy)
Adds the tile. (Same as the RPG Maker MZ method of this name.)
setTileAnimation
method sourceTilemap.prototype.setTileAnimation(frames, water)
Tile animation a tileset sets out (an RPG Maker 2000/2003 import): frames maps a tile id to the ids it shows in turn, a frame every 6 game frames; water gives the water's step in frames and its cycle (4: frames 1-2-3-2, 3: 1-2-3).
Details
Tile animation a tileset sets out (an RPG Maker 2000/2003 import): frames maps a tile id to the ids it shows
in turn, a frame every 6 game frames; water gives the water's step in frames and its cycle (4: frames
1-2-3-2, 3: 1-2-3). Only tiles the map uses are kept, so a map without them never repaints for them.
_addNormalTile
method internal sourceTilemap.prototype._addNormalTile(layer, tileId, dx, dy)
Adds the normal tile. (Same as the RPG Maker MZ method of this name.)
_addAutotile
method internal sourceTilemap.prototype._addAutotile(layer, tileId, dx, dy)
Adds the autotile. (Same as the RPG Maker MZ method of this name.)
_addTableEdge
method internal sourceTilemap.prototype._addTableEdge(layer, tileId, dx, dy)
Adds the table edge. (Same as the RPG Maker MZ method of this name.)
_addShadow
method internal sourceTilemap.prototype._addShadow(layer, shadowBits, dx, dy)
Adds the shadow. (Same as the RPG Maker MZ method of this name.)
Updating & Drawing
update
method sourceTilemap.prototype.update()
Updates the tilemap for each frame.
_syncV8TileLayers
method internal sourceTilemap.prototype._syncV8TileLayers()
Sync v8 tile layers. (Same as the RPG Maker MZ method of this name.)
refresh
method sourceTilemap.prototype.refresh()
Forces to repaint the entire tilemap.
updateTransform
method sourceTilemap.prototype.updateTransform()
Updates the transform on all children of this container for rendering.
_updateBitmaps
method internal sourceTilemap.prototype._updateBitmaps()
Updates the bitmaps each frame. (Same as the RPG Maker MZ method of this name.)
Renderer
static sourceTilemap.Renderer()
Renderer. (Same as the RPG Maker MZ method of this name.)
Other
_rrChunksSkipped
method internal sourceTilemap.prototype._rrChunksSkipped()
Rr chunks skipped. (Same as the RPG Maker MZ method of this name.)
CombinedLayer
static sourceTilemap.CombinedLayer()
Combined layer. (Same as the RPG Maker MZ method of this name.)
_rrChunkBlocker
method internal sourceTilemap.prototype._rrChunkBlocker()
Why this frame keeps the full paint, or null when it paints in chunks.
ChunkRecorder
static sourceTilemap.ChunkRecorder(tilemap)
Collects one chunk's rects as the painting hooks hand them to a layer, with the water motion _addAutotile marks them with.
_rrEnterChunks
method internal sourceTilemap.prototype._rrEnterChunks()
Rr enter chunks. (Same as the RPG Maker MZ method of this name.)
_rrLeaveChunks
method internal sourceTilemap.prototype._rrLeaveChunks()
Rr leave chunks. (Same as the RPG Maker MZ method of this name.)
_rrDestroyChunkPart
method internal sourceTilemap.prototype._rrDestroyChunkPart(part)
Rr destroy chunk part. (Same as the RPG Maker MZ method of this name.)
_rrResetChunks
method internal sourceTilemap.prototype._rrResetChunks(state)
Every block goes back to the pool: the tileset, the map or its flags changed, or refresh() was called.
_rrChunksStale
method internal sourceTilemap.prototype._rrChunksStale(state)
Rr chunks stale. (Same as the RPG Maker MZ method of this name.)
_rrChunkKey
static internal sourceTilemap._rrChunkKey(cx, cy)
Rr chunk key. (Same as the RPG Maker MZ method of this name.)
_rrPaintChunks
method internal sourceTilemap.prototype._rrPaintChunks(startX, startY)
Paints this frame in chunks; false (after handing back to the full paint) when that fails.
_rrShowChunk
method internal sourceTilemap.prototype._rrShowChunk(chunk, shown)
Rr show chunk. (Same as the RPG Maker MZ method of this name.)
_rrReleaseChunk
method internal sourceTilemap.prototype._rrReleaseChunk(state, chunk)
Rr release chunk. (Same as the RPG Maker MZ method of this name.)
_rrBuildChunk
method internal sourceTilemap.prototype._rrBuildChunk(state, cx, cy, now)
Paints one block through the painting hooks, into recorders standing in for the canonical layers, at water frame 0, and makes its meshes.
Details
Paints one block through the painting hooks, into recorders standing in
for the canonical layers, at water frame 0, and makes its meshes. now:
the view needs it this frame (shown at once).
_rrChunkPart
method internal sourceTilemap.prototype._rrChunkPart(state, part, recorder, root, left, top)
One layer's mesh of a block, from its recorder: reuses the part it had or a pooled one.
_rrAnimateChunk
method internal sourceTilemap.prototype._rrAnimateChunk(state, chunk)
The water frame on a block's animated quads: water slides along x, falls along y.
_rrChunkSnapshot
method internal sourceTilemap.prototype._rrChunkSnapshot(chunk, into)
The map data a block was painted from: layers 0-4 of its tiles and of the row above (table edges).
_rrChunkChanged
method internal sourceTilemap.prototype._rrChunkChanged(chunk)
Rr chunk changed. (Same as the RPG Maker MZ method of this name.)
_rrKeepUsedTileFrames
method internal sourceTilemap.prototype._rrKeepUsedTileFrames()
The animated tiles the map shows now.
Details
The animated tiles the map shows now. A tile changed after load (a substitution, then refresh) is asked for again.
_readMapData
method internal sourceTilemap.prototype._readMapData(x, y, z)
Read map data. (Same as the RPG Maker MZ method of this name.)
_sortChildren
method internal sourceTilemap.prototype._sortChildren()
Sort children. (Same as the RPG Maker MZ method of this name.)
_compareChildOrder
method internal sourceTilemap.prototype._compareChildOrder(a, b)
Compare child order. (Same as the RPG Maker MZ method of this name.)
Layer
static sourceTilemap.Layer()
Layer. (Same as the RPG Maker MZ method of this name.)