API Docs for:
Show:

gs.TilemapLayer Class

A tilemap layer is used to display a single layer of a gs.Tilemap. It is not recommended to use this class directly. For more information about how to use tilemaps, features and limitations please read the "Scripter's Guide" in the help-file.

Constructor

gs.TilemapLayer

(
  • viewport
  • tilemap
  • width
  • height
  • mapData
  • tileSize
  • tilesetBitmap
  • animationSpeed
)

Parameters:

  • viewport gs.Viewport
    • The viewport to associate the tilemap layer with.
  • tilemap gs.Tilemap
    • The tilemap to associate the tilemap layer with.
  • width Number
    • The width of the layer in tiles.
  • height Number
    • The height of the layer in tiles.
  • mapData Number
    • The map-data for the layer.
  • tileSize Number
    • The tile-size of this layer.
  • tilesetBitmap Number
    • The tileset to use.
  • animationSpeed Number
    • The animation speed for animated tiles. (The duration in frames before next pattern is displayed)

Methods

dispose

()

Disposes the tilemap layer and frees resources. Should be called if the tilemap layer is no longer needed.

update

()

Updates the tilemap layer. Must be called once per frame.

Properties

angle

Number

The rotation angle.

animationSpeed

Number

The animation speed for animated tiles. (The duration in frames before the next pattern is displayed)

color

Boolean

The color. Can be used for flashing-effects, etc.

mask

gs.Mask

The mask used for masking-effects.

tilemap

gs.Tilemap

The tilemap associated with the layer.

tilesetBitmap

gs.Bitmap

The tileset used for this layer.

tileSize

Number

The size of a single tile. A single tile needs to be quadratic so a value of 32 means 32x32 pixels.

tone

gs.Tone

The color tone.

zoomX

Number

The zoom on x-axis.

zoomY

Number

The zoom on y-axis.