Tilemap

The class governing tilemaps. Tilemaps are a specialized concept used in 2D game map displays, created internally from multiple sprites.

Superclass

Class Method

Tilemap.new([viewport])

Creates a Tilemap object. Specifies a Viewport (Viewport) when necessary.

Methods

dispose

Frees the tilemap. If the tilemap has already been freed, does nothing.

disposed?

Returns TRUE if the tilemap has been freed.

viewport

Gets the Viewport (Viewport) specified when the tilemap was created.

update

Updates the autotile animation, etc. As a rule, this method is called once per frame.

Properties

tileset

Refers to the bitmap (Bitmap) used as a tileset.

autotiles[index]

Refers to the bitmap (Bitmap) used as an autotile with an index number from 0 to 6.

map_data

Refers to map data (Table). Defines a 3-dimensional array measuring [ horizontal size * vertical size * 3 ].

flash_data

Refers to the flash data (Table) used when showing range of possible movement in simulation games, etc. Defines a 2-dimensional array measuring [ horizontal size * vertical size ]. This array must be the same size as the map data. Each element uses 4 bits to represent a tile's flash color in RGB; for example, 0xf84 flashes in RGB(15,8,4).

priorities

Reference to the priority table (Table). Defines a 1-dimensional array containing elements corresponding to tile IDs.

visible

The tilemap's visibility. If TRUE, the tilemap is visible.

ox

The X-coordinate of the tilemap's starting point. Change this value to scroll the tilemap.

oy

The Y-coordinate of the tilemap's starting point. Change this value to scroll the tilemap.

Notes

The Z-coordinate of each sprite used to create a tilemap is fixed at a specific value.

  1. Tiles with a priority of 0 always have a Z-coordinate of 0.
  2. Priority 1 tiles placed at the top edge of the screen have a Z-coordinate of 64.
  3. Every time the priority increases by 1 or the next tile down is selected, the Z-coordinate increases by 32.
  4. The Z-coordinate changes accordingly as the tilemap scrolls vertically.

Keep these rules in mind when setting the Z-coordinates of any map characters.

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)