- Source: src/tilemaps/typedefs/index.js (Line 7)
Type Definitions
-
CreateFromObjectLayerConfig
-
Type:
- object
- Since: 3.50.0
- Source: src/tilemaps/typedefs/CreateFromObjectLayerConfig.js (Line 1)
Properties:
Name Type Argument Default Description idnumber <optional>
A unique Object ID to convert.
gidnumber <optional>
An Object GID to convert.
namestring <optional>
An Object Name to convert.
classTypePhaser.GameObjects.GameObject <optional>
Phaser.GameObjects.Sprite A custom class type to convert the objects in to.
scenePhaser.Scene <optional>
A Scene reference, passed to the Game Objects constructors.
containerPhaser.GameObjects.Container <optional>
Optional Container to which the Game Objects are added.
keystring | Phaser.Textures.Texture <optional>
Optional key of a Texture to be used, as stored in the Texture Manager, or a Texture instance.
framestring | number <optional>
Optional name or index of the frame within the Texture.
-
DebugStyleOptions
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/DebugStyleOptions.js (Line 1)
Properties:
Name Type Argument Default Description styleConfig.tileColorPhaser.Display.Color <optional>
<nullable>
blue Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn.
styleConfig.collidingTileColorPhaser.Display.Color <optional>
<nullable>
orange Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
styleConfig.faceColorPhaser.Display.Color <optional>
<nullable>
grey Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn.
-
FilteringOptions
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/FilteringOptions.js (Line 1)
Properties:
Name Type Argument Default Description isNotEmptyboolean <optional>
false If true, only return tiles that don't have -1 for an index.
isCollidingboolean <optional>
false If true, only return tiles that collide on at least one side.
hasInterestingFaceboolean <optional>
false If true, only return tiles that have at least one interesting face.
-
GIDData
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/GIDData.js (Line 1)
Properties:
Name Type Description gidnumber The Tiled GID.
flippedHorizontalboolean Horizontal flip flag.
flippedVerticalboolean Vertical flip flag.
flippedAntiDiagonalboolean Diagonal flip flag.
rotationnumber Amount of rotation.
flippedboolean Is flipped?
-
LayerDataConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/LayerDataConfig.js (Line 1)
Properties:
Name Type Argument Default Description namestring <optional>
The name of the layer, if specified in Tiled.
xnumber <optional>
0 The x offset of where to draw from the top left.
ynumber <optional>
0 The y offset of where to draw from the top left.
widthnumber <optional>
0 The width of the layer in tiles.
heightnumber <optional>
0 The height of the layer in tiles.
tileWidthnumber <optional>
0 The pixel width of the tiles.
tileHeightnumber <optional>
0 The pixel height of the tiles.
baseTileWidthnumber <optional>
0 The base tile width.
baseTileHeightnumber <optional>
0 The base tile height.
widthInPixelsnumber <optional>
0 The width in pixels of the entire layer.
heightInPixelsnumber <optional>
0 The height in pixels of the entire layer.
alphanumber <optional>
1 The alpha value of the layer.
visibleboolean <optional>
true Is the layer visible or not?
propertiesArray.<object> <optional>
Layer specific properties (can be specified in Tiled)
indexesarray <optional>
Tile ID index map.
collideIndexesarray <optional>
Tile Collision ID index map.
callbacksarray <optional>
An array of callbacks.
bodiesarray <optional>
An array of physics bodies.
dataarray <optional>
An array of the tile data indexes.
tilemapLayerPhaser.Tilemaps.TilemapLayer <optional>
A reference to the Tilemap layer that owns this data.
-
MapDataConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/MapDataConfig.js (Line 1)
Properties:
Name Type Argument Default Description namestring <optional>
The key in the Phaser cache that corresponds to the loaded tilemap data.
widthnumber <optional>
0 The width of the entire tilemap.
heightnumber <optional>
0 The height of the entire tilemap.
tileWidthnumber <optional>
0 The width of the tiles.
tileHeightnumber <optional>
0 The height of the tiles.
widthInPixelsnumber <optional>
The width in pixels of the entire tilemap.
heightInPixelsnumber <optional>
The height in pixels of the entire tilemap.
formatnumber <optional>
The format of the Tilemap, as defined in Tiled.
orientationstring <optional>
The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'.
renderOrderstring <optional>
Determines the draw order of tilemap. Default is right-down.
versionnumber <optional>
The version of Tiled the map uses.
propertiesnumber <optional>
Map specific properties (can be specified in Tiled).
layersArray.<Phaser.Tilemaps.LayerData> <optional>
The layers of the tilemap.
imagesarray <optional>
An array with all the layers configured to the MapData.
objectsobject <optional>
An array of Tiled Image Layers.
collisionobject <optional>
An object of Tiled Object Layers.
tilesetsArray.<Phaser.Tilemaps.Tileset> <optional>
The tilesets the map uses.
imageCollectionsarray <optional>
The collection of images the map uses(specified in Tiled).
tilesarray <optional>
Array of Tile instances.
-
ObjectLayerConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/ObjectLayerConfig.js (Line 1)
Properties:
Name Type Argument Default Description namestring <optional>
'object layer' The name of the Object Layer.
opacitynumber <optional>
1 The opacity of the layer, between 0 and 1.
propertiesany <optional>
The custom properties defined on the Object Layer, keyed by their name.
propertytypesany <optional>
The type of each custom property defined on the Object Layer, keyed by its name.
typestring <optional>
'objectgroup' The type of the layer, which should be
objectgroup.visibleboolean <optional>
true Whether the layer is shown (
true) or hidden (false).objectsArray.<any> <optional>
An array of all objects on this Object Layer.
-
StyleConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/StyleConfig.js (Line 1)
Properties:
Name Type Argument Default Description tileColorPhaser.Display.Color | number | null <optional>
<nullable>
blue Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn.
collidingTileColorPhaser.Display.Color | number | null <optional>
<nullable>
orange Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
faceColorPhaser.Display.Color | number | null <optional>
<nullable>
grey Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn.
-
TiledObject
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/TiledObject.js (Line 1)
Properties:
Name Type Argument Description idnumber The unique object ID.
namestring The name this object was assigned in Tiled.
typestring The type, as assigned in Tiled.
visibleboolean <optional>
The visible state of this object.
xnumber <optional>
The horizontal position of this object, in pixels, relative to the tilemap.
ynumber <optional>
The vertical position of this object, in pixels, relative to the tilemap.
widthnumber <optional>
The width of this object, in pixels.
heightnumber <optional>
The height of this object, in pixels.
rotationnumber <optional>
The rotation of the object in clockwise degrees.
propertiesany <optional>
Custom properties object.
gidnumber <optional>
Only set if of type 'tile'.
flippedHorizontalboolean <optional>
Only set if a tile object. The horizontal flip value.
flippedVerticalboolean <optional>
Only set if a tile object. The vertical flip value.
flippedAntiDiagonalboolean <optional>
Only set if a tile object. The diagonal flip value.
polylineArray.<Phaser.Types.Math.Vector2Like> <optional>
Only set if a polyline object. An array of objects corresponding to points, where each point has an
xproperty and ayproperty.polygonArray.<Phaser.Types.Math.Vector2Like> <optional>
Only set if a polygon object. An array of objects corresponding to points, where each point has an
xproperty and ayproperty.textany <optional>
Only set if a text object. Contains the text objects properties.
rectangleboolean <optional>
Only set, and set to
true, if a rectangle object.ellipseboolean <optional>
Only set, and set to
true, if a ellipse object.pointboolean <optional>
Only set, and set to
true, if a point object. -
TilemapConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/tilemaps/typedefs/TilemapConfig.js (Line 1)
Properties:
Name Type Argument Default Description keystring <optional>
The key in the Phaser cache that corresponds to the loaded tilemap data.
dataArray.<Array.<number>> <optional>
Instead of loading from the cache, you can also load directly from a 2D array of tile indexes.
tileWidthnumber <optional>
32 The width of a tile in pixels.
tileHeightnumber <optional>
32 The height of a tile in pixels.
widthnumber <optional>
10 The width of the map in tiles.
heightnumber <optional>
10 The height of the map in tiles.
insertNullboolean <optional>
false Controls how empty tiles, tiles with an index of -1, in the map data are handled. If
true, empty locations will get a value ofnull. Iffalse, empty location will get a Tile object with an index of -1. If you've a large sparsely populated map and the tile data doesn't need to change then setting this value totruewill help with memory consumption. However if your map is small or you need to update the tiles dynamically, then leave the default value set.
