Phaser API Documentation

  Version: 
Only webGL setTint([tint], [tileX], [tileY], [width], [height], [filteringOptions])

Description:

Sets an additive tint on each Tile within the given area.

The tint works by taking the pixel color values from the tileset texture, and then multiplying it by the color value of the tint.

If no area values are given then all tiles will be tinted to the given color.

To remove a tint call this method with either no parameters, or by passing white 0xffffff as the tint color.

If a tile already has a tint set then calling this method will override that.

Parameters:

name type arguments Default description
tint number <optional> 0xffffff

The tint color being applied to each tile within the region. Given as a hex value, i.e. 0xff0000 for red. Set to white (0xffffff) to reset the tint.

tileX number <optional>

The left most tile index (in tile coordinates) to use as the origin of the area to search.

tileY number <optional>

The top most tile index (in tile coordinates) to use as the origin of the area to search.

width number <optional>

How many tiles wide from the tileX index the area will be.

height number <optional>

How many tiles tall from the tileY index the area will be.

filteringOptions Phaser.Types.Tilemaps.FilteringOptions <optional>

Optional filters to apply when getting the tiles.

Returns:
Description:

This Tilemap Layer object.

Since: 3.60.0