Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord

Phaser . Tilemaps . Tile

This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord

Phaser . Tilemaps . Tile

A Tile is a representation of a single tile within the Tilemap. This is a lightweight data representation, so its position information is stored without factoring in scroll, layer scale or layer position.

Constructor:

new Tile(layer, index, x, y, width, height, baseWidth, baseHeight)

Parameters:

name type description
layer Phaser.Tilemaps.LayerData

The LayerData object in the Tilemap that this tile belongs to.

index number

The unique index of this tile within the map.

x number

The x coordinate of this tile in tile coordinates.

y number

The y coordinate of this tile in tile coordinates.

width number

Width of the tile in pixels.

height number

Height of the tile in pixels.

baseWidth number

The base width a tile in the map (in pixels). Tiled maps support multiple tileset sizes within one map, but they are still placed at intervals of the base tile width.

baseHeight number

The base height of the tile in pixels (in pixels). Tiled maps support multiple tileset sizes within one map, but they are still placed at intervals of the base tile height.

Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 12)

Extends


Members

<private> _alpha: number
Focus
Focus

Description:

Private internal value. Holds the global alpha value.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Alpha#_alpha
Since: 3.0.0
Focus
Focus
<private> _alphaBL: number
Focus
Focus

Description:

Private internal value. Holds the bottom-left alpha value.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Alpha#_alphaBL
Since: 3.0.0
Focus
Focus
<private> _alphaBR: number
Focus
Focus

Description:

Private internal value. Holds the bottom-right alpha value.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Alpha#_alphaBR
Since: 3.0.0
Focus
Focus
<private> _alphaTL: number
Focus
Focus

Description:

Private internal value. Holds the top-left alpha value.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Alpha#_alphaTL
Since: 3.0.0
Focus
Focus
<private> _alphaTR: number
Focus
Focus

Description:

Private internal value. Holds the top-right alpha value.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Alpha#_alphaTR
Since: 3.0.0
Focus
Focus
<private> _visible: boolean
Focus
Focus

Description:

Private internal value. Holds the visible value.

Type:
boolean
Default: true
Inherited from: Phaser.GameObjects.Components.Visible#_visible
Since: 3.0.0
Focus
Focus
alpha: number
Focus
Focus

Description:

The alpha value of the Game Object.

This is a global value, impacting the entire Game Object, not just a region of it.

Type:
number
Inherited from: Phaser.GameObjects.Components.Alpha#alpha
Since: 3.0.0
Focus
Focus
Only webGL alphaBottomLeft: number
Focus
Focus

Description:

The alpha value starting from the bottom-left of the Game Object. This value is interpolated from the corner to the center of the Game Object.

Type:
number
Inherited from: Phaser.GameObjects.Components.Alpha#alphaBottomLeft
Since: 3.0.0
Focus
Focus
Only webGL alphaBottomRight: number
Focus
Focus

Description:

The alpha value starting from the bottom-right of the Game Object. This value is interpolated from the corner to the center of the Game Object.

Type:
number
Inherited from: Phaser.GameObjects.Components.Alpha#alphaBottomRight
Since: 3.0.0
Focus
Focus
Only webGL alphaTopLeft: number
Focus
Focus

Description:

The alpha value starting from the top-left of the Game Object. This value is interpolated from the corner to the center of the Game Object.

Type:
number
Inherited from: Phaser.GameObjects.Components.Alpha#alphaTopLeft
Since: 3.0.0
Focus
Focus
Only webGL alphaTopRight: number
Focus
Focus

Description:

The alpha value starting from the top-right of the Game Object. This value is interpolated from the corner to the center of the Game Object.

Type:
number
Inherited from: Phaser.GameObjects.Components.Alpha#alphaTopRight
Since: 3.0.0
Focus
Focus
baseHeight: number
Focus
Focus

Description:

The maps base height of a tile in pixels. Tiled maps support multiple tileset sizes within one map, but they are still placed at intervals of the base tile size.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 139)
Focus
Focus
baseWidth: number
Focus
Focus

Description:

The maps base width of a tile in pixels. Tiled maps support multiple tileset sizes within one map, but they are still placed at intervals of the base tile size.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 129)
Focus
Focus
bottom: number
Focus
Focus

Description:

The bottom of the tile in pixels.

Set in the updatePixelXY method.

Type:
number
Since: 3.50.0
Source: src/tilemaps/Tile.js (Line 118)
Focus
Focus
<readonly> canCollide: boolean
Focus
Focus

Description:

True if this tile can collide on any of its faces or has a collision callback set.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 793)
Focus
Focus
collideDown: boolean
Focus
Focus

Description:

Whether the tile should collide with any object on the bottom side.

This property is used by Arcade Physics only, however, you can also use it in your own checks.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 227)
Focus
Focus
collideLeft: boolean
Focus
Focus

Description:

Whether the tile should collide with any object on the left side.

This property is used by Arcade Physics only, however, you can also use it in your own checks.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 191)
Focus
Focus
collideRight: boolean
Focus
Focus

Description:

Whether the tile should collide with any object on the right side.

This property is used by Arcade Physics only, however, you can also use it in your own checks.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 203)
Focus
Focus
collideUp: boolean
Focus
Focus

Description:

Whether the tile should collide with any object on the top side.

This property is used by Arcade Physics only, however, you can also use it in your own checks.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 215)
Focus
Focus
<readonly> collides: boolean
Focus
Focus

Description:

True if this tile can collide on any of its faces.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 810)
Focus
Focus
collisionCallback: function
Focus
Focus

Description:

Tile collision callback.

Type:
function
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 275)
Focus
Focus
collisionCallbackContext: object
Focus
Focus

Description:

The context in which the collision callback will be called.

Type:
object
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 284)
Focus
Focus
faceBottom: boolean
Focus
Focus

Description:

Whether the tiles bottom edge is interesting for collisions.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 266)
Focus
Focus
faceLeft: boolean
Focus
Focus

Description:

Whether the tiles left edge is interesting for collisions.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 239)
Focus
Focus
faceRight: boolean
Focus
Focus

Description:

Whether the tiles right edge is interesting for collisions.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 248)
Focus
Focus
faceTop: boolean
Focus
Focus

Description:

Whether the tiles top edge is interesting for collisions.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 257)
Focus
Focus
flipX: boolean
Focus
Focus

Description:

The horizontally flipped state of the Game Object.

A Game Object that is flipped horizontally will render inversed on the horizontal axis. Flipping always takes place from the middle of the texture and does not impact the scale value. If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Type:
boolean
Default: false
Inherited from: Phaser.GameObjects.Components.Flip#flipX
Since: 3.0.0
Focus
Focus
flipY: boolean
Focus
Focus

Description:

The vertically flipped state of the Game Object.

A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) Flipping always takes place from the middle of the texture and does not impact the scale value. If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Type:
boolean
Default: false
Inherited from: Phaser.GameObjects.Components.Flip#flipY
Since: 3.0.0
Focus
Focus
<readonly> hasInterestingFace: boolean
Focus
Focus

Description:

True if this tile has any interesting faces.

Type:
boolean
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 827)
Focus
Focus
height: number
Focus
Focus

Description:

The height of the tile in pixels.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 98)
Focus
Focus
index: number
Focus
Focus

Description:

The index of this tile within the map data corresponding to the tileset, or -1 if this represents a blank tile.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 61)
Focus
Focus

Description:

The LayerData in the Tilemap data that this tile belongs to.

Type:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 52)
Focus
Focus
physics: object
Focus
Focus

Description:

An empty object where physics-engine specific information (e.g. bodies) may be stored.

Type:
object
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 304)
Focus
Focus
pixelX: number
Focus
Focus

Description:

The x coordinate of the top left of this tile in pixels. This is relative to the top left of the layer this tile is being rendered within. This property does NOT factor in camera scroll, layer scale or layer position.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 149)
Focus
Focus
pixelY: number
Focus
Focus

Description:

The y coordinate of the top left of this tile in pixels. This is relative to the top left of the layer this tile is being rendered within. This property does NOT factor in camera scroll, layer scale or layer position.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 160)
Focus
Focus
properties: any
Focus
Focus

Description:

Tile specific properties. These usually come from Tiled.

Type:
any
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 173)
Focus
Focus
rotation: number
Focus
Focus

Description:

The rotation angle of this tile.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 182)
Focus
Focus
<readonly, nullable> tilemap: Phaser.Tilemaps.Tilemap
Focus
Focus

Description:

The tilemap that contains this Tile. This will only return null if accessed from a LayerData instance before the tile is placed within a TilemapLayer.

Type:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 893)
Focus
Focus
<readonly, nullable> tilemapLayer: Phaser.Tilemaps.TilemapLayer
Focus
Focus

Description:

The tilemap layer that contains this Tile. This will only return null if accessed from a LayerData instance before the tile is placed within a TilemapLayer.

Type:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 875)
Focus
Focus
<readonly, nullable> tileset: Phaser.Tilemaps.Tileset
Focus
Focus

Description:

The tileset that contains this Tile. This is null if accessed from a LayerData instance before the tile is placed in a TilemapLayer, or if the tile has an index that doesn't correspond to any of the maps tilesets.

Type:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 844)
Focus
Focus
tint: number
Focus
Focus

Description:

The tint to apply to this tile. Note: tint is currently a single color value instead of the 4 corner tint component on other GameObjects.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 293)
Focus
Focus
visible: boolean
Focus
Focus

Description:

The visible state of the Game Object.

An invisible Game Object will skip rendering, but will still process update logic.

Type:
boolean
Inherited from: Phaser.GameObjects.Components.Visible#visible
Since: 3.0.0
Focus
Focus
width: number
Focus
Focus

Description:

The width of the tile in pixels.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 89)
Focus
Focus
x: number
Focus
Focus

Description:

The x map coordinate of this tile in tile units.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 71)
Focus
Focus
y: number
Focus
Focus

Description:

The y map coordinate of this tile in tile units.

Type:
number
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 80)
Focus
Focus

Methods

clearAlpha()
Focus
Focus

Description:

Clears all alpha values associated with this Game Object.

Immediately sets the alpha levels back to 1 (fully opaque).

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Alpha#clearAlpha
Examples:
Since: 3.0.0
Focus
Focus
containsPoint(x, y)
Focus
Focus

Description:

Check if the given x and y world coordinates are within this Tile. This does not factor in camera scroll, layer scale or layer position.

Parameters:

name type description
x number

The x coordinate to test.

y number

The y coordinate to test.

Returns:
Description:

True if the coordinates are within this Tile, otherwise false.

Type:
  • boolean
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 314)
Focus
Focus
copy(tile)
Focus
Focus

Description:

Copies the tile data & properties from the given tile to this tile. This copies everything except for position and interesting faces.

Parameters:

name type description
tile Phaser.Tilemaps.Tile

The tile to copy from.

Returns:
Description:

This Tile object instance.

Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 331)
Focus
Focus
destroy()
Focus
Focus

Description:

Clean up memory.

Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 780)
Focus
Focus
getBottom([camera])
Focus
Focus

Description:

Gets the world Y position of the bottom side of the tile, factoring in the layer's position, scale and scroll.

Parameters:

name type arguments description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera to use to perform the check.

Returns:
Description:

The bottom (y) value of this tile.

Type:
  • number
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 451)
Focus
Focus
getBounds([camera], [output])
Focus
Focus

Description:

Gets the world rectangle bounding box for the tile, factoring in the layers position, scale and scroll.

Parameters:

name type arguments description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera to use to perform the check.

output Phaser.Geom.Rectangle <optional>

Optional Rectangle object to store the results in.

Returns:
Description:

The bounds of this Tile.

Type:
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 472)
Focus
Focus
getCenterX([camera])
Focus
Focus

Description:

Gets the world X position of the center of the tile, factoring in the layer's position, scale and scroll.

Parameters:

name type arguments description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera to use to perform the check.

Returns:
Description:

The center x position of this Tile.

Type:
  • number
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 496)
Focus
Focus
getCenterY([camera])
Focus
Focus

Description:

Gets the world Y position of the center of the tile, factoring in the layer's position, scale and scroll.

Parameters:

name type arguments description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera to use to perform the check.

Returns:
Description:

The center y position of this Tile.

Type:
  • number
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 512)
Focus
Focus
getCollisionGroup()
Focus
Focus

Description:

The collision group for this Tile, defined within the Tileset. This returns a reference to the collision group stored within the Tileset, so any modification of the returned object will impact all tiles that have the same index as this tile.

Returns:
Description:

The collision group for this Tile, as defined in the Tileset, or null if no group was defined.

Type:
  • object
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 361)
Focus
Focus
getLeft([camera])
Focus
Focus

Description:

Gets the world X position of the left side of the tile, factoring in the layers position, scale and scroll.

Parameters:

name type arguments description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera to use to perform the check.

Returns:
Description:

The left (x) value of this tile.

Type:
  • number
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 392)
Focus
Focus
getRight([camera])
Focus
Focus

Description:

Gets the world X position of the right side of the tile, factoring in the layer's position, scale and scroll.

Parameters:

name type arguments description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera to use to perform the check.

Returns:
Description:

The right (x) value of this tile.

Type:
  • number
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 410)
Focus
Focus
getTileData()
Focus
Focus

Description:

The tile data for this Tile, defined within the Tileset. This typically contains Tiled collision data, tile animations and terrain information. This returns a reference to the tile data stored within the Tileset, so any modification of the returned object will impact all tiles that have the same index as this tile.

Returns:
Description:

The tile data for this Tile, as defined in the Tileset, or null if no data was defined.

Type:
  • object
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 376)
Focus
Focus
getTop([camera])
Focus
Focus

Description:

Gets the world Y position of the top side of the tile, factoring in the layer's position, scale and scroll.

Parameters:

name type arguments description
camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera to use to perform the check.

Returns:
Description:

The top (y) value of this tile.

Type:
  • number
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 428)
Focus
Focus
intersects(x, y, right, bottom)
Focus
Focus

Description:

Check for intersection with this tile. This does not factor in camera scroll, layer scale or layer position.

Parameters:

name type description
x number

The x axis in pixels.

y number

The y axis in pixels.

right number

The right point.

bottom number

The bottom point.

Returns:
Description:

true if the Tile intersects with the given dimensions, otherwise false.

Type:
  • boolean
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 528)
Focus
Focus
isInteresting(collides, faces)
Focus
Focus

Description:

Checks if the tile is interesting.

Parameters:

name type description
collides boolean

If true, will consider the tile interesting if it collides on any side.

faces boolean

If true, will consider the tile interesting if it has an interesting face.

Returns:
Description:

True if the Tile is interesting, otherwise false.

Type:
  • boolean
Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 550)
Focus
Focus
resetCollision([recalculateFaces])
Focus
Focus

Description:

Reset collision status flags.

Parameters:

name type arguments Default description
recalculateFaces boolean <optional> true

Whether or not to recalculate interesting faces for this tile and its neighbors.

Returns:
Description:

This Tile object instance.

Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 579)
Focus
Focus
resetFaces()
Focus
Focus

Description:

Reset faces.

Returns:
Description:

This Tile object instance.

Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 616)
Focus
Focus
resetFlip()
Focus
Focus

Description:

Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Flip#resetFlip
Examples:
Since: 3.0.0
Focus
Focus
setAlpha([topLeft], [topRight], [bottomLeft], [bottomRight])
Focus
Focus

Description:

Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.

If your game is running under WebGL you can optionally specify four different alpha values, each of which correspond to the four corners of the Game Object. Under Canvas only the topLeft value given is used.

Parameters:

name type arguments Default description
topLeft number <optional> 1

The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object.

topRight number <optional>

The alpha value used for the top-right of the Game Object. WebGL only.

bottomLeft number <optional>

The alpha value used for the bottom-left of the Game Object. WebGL only.

bottomRight number <optional>

The alpha value used for the bottom-right of the Game Object. WebGL only.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Alpha#setAlpha
Examples:
Since: 3.0.0
Focus
Focus
setCollision(left, [right], [up], [down], [recalculateFaces])
Focus
Focus

Description:

Sets the collision flags for each side of this tile and updates the interesting faces list.

Parameters:

name type arguments Default description
left boolean

Indicating collide with any object on the left.

right boolean <optional>

Indicating collide with any object on the right.

up boolean <optional>

Indicating collide with any object on the top.

down boolean <optional>

Indicating collide with any object on the bottom.

recalculateFaces boolean <optional> true

Whether or not to recalculate interesting faces for this tile and its neighbors.

Returns:
Description:

This Tile object instance.

Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 634)
Focus
Focus
setCollisionCallback(callback, context)
Focus
Focus

Description:

Set a callback to be called when this tile is hit by an object. The callback must true for collision processing to take place.

Parameters:

name type description
callback function

Callback function.

context object

Callback will be called within this context.

Returns:
Description:

This Tile object instance.

Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 678)
Focus
Focus
setFlip(x, y)
Focus
Focus

Description:

Sets the horizontal and vertical flipped state of this Game Object.

A Game Object that is flipped will render inversed on the flipped axis. Flipping always takes place from the middle of the texture and does not impact the scale value. If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Parameters:

name type description
x boolean

The horizontal flipped state. false for no flip, or true to be flipped.

y boolean

The horizontal flipped state. false for no flip, or true to be flipped.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Flip#setFlip
Examples:
Since: 3.0.0
Focus
Focus
setFlipX(value)
Focus
Focus

Description:

Sets the horizontal flipped state of this Game Object.

A Game Object that is flipped horizontally will render inversed on the horizontal axis. Flipping always takes place from the middle of the texture and does not impact the scale value. If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Parameters:

name type description
value boolean

The flipped state. false for no flip, or true to be flipped.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Flip#setFlipX
Examples:
Since: 3.0.0
Focus
Focus
setFlipY(value)
Focus
Focus

Description:

Sets the vertical flipped state of this Game Object.

Parameters:

name type description
value boolean

The flipped state. false for no flip, or true to be flipped.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Flip#setFlipY
Examples:
Since: 3.0.0
Focus
Focus
setSize(tileWidth, tileHeight, baseWidth, baseHeight)
Focus
Focus

Description:

Sets the size of the tile and updates its pixelX and pixelY.

Parameters:

name type description
tileWidth number

The width of the tile in pixels.

tileHeight number

The height of the tile in pixels.

baseWidth number

The base width a tile in the map (in pixels).

baseHeight number

The base height of the tile in pixels (in pixels).

Returns:
Description:

This Tile object instance.

Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 706)
Focus
Focus
setVisible(value)
Focus
Focus

Description:

Sets the visibility of this Game Object.

An invisible Game Object will skip rendering, but will still process update logic.

Parameters:

name type description
value boolean

The visible state of the Game Object.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Visible#setVisible
Examples:
Since: 3.0.0
Focus
Focus
toggleFlipX()
Focus
Focus

Description:

Toggles the horizontal flipped state of this Game Object.

A Game Object that is flipped horizontally will render inversed on the horizontal axis. Flipping always takes place from the middle of the texture and does not impact the scale value. If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Flip#toggleFlipX
Examples:
Since: 3.0.0
Focus
Focus
toggleFlipY()
Focus
Focus

Description:

Toggles the vertical flipped state of this Game Object.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Flip#toggleFlipY
Examples:
Since: 3.0.0
Focus
Focus
updatePixelXY()
Focus
Focus

Description:

Used internally. Updates the tiles world XY position based on the current tile size.

Returns:
Description:

This Tile object instance.

Examples:
Since: 3.0.0
Source: src/tilemaps/Tile.js (Line 731)
Focus
Focus