Tile library for tilemaps.
    public class TileSet : Resource

A TileSet is a library of tiles for a TileMap. It contains a list of tiles, each consisting of a sprite and optional collision shapes.

Tiles are referenced by a unique integer ID.

Inheritance Chain

Constructors

    public TileSet()

Methods

    public virtual Vector2 _ForwardSubtileSelection(int autotileId, int bitmask, Object tilemap, Vector2 tileLocation)

    public virtual bool _IsTileBound(int drawnId, int neighborId)

    public BitmaskMode AutotileGetBitmaskMode(int id)

    public void AutotileSetBitmaskMode(int id, BitmaskMode mode)

    public void Clear()

Clear all tiles.

    public void CreateTile(int id)

Create a new tile which will be referenced by the given ID.

    public int FindTileByName(string name)

Find the first tile matching the given name.

    public int GetLastUnusedTileId()

Return the ID following the last currently used ID, useful when creating a new tile.

    public object[] GetTilesIds()

Return an array of all currently used tile IDs.

    public void RemoveTile(int id)

Remove the tile referenced by the given ID.

    public void TileAddShape(int id, Shape2D shape, Transform2D shapeTransform, bool oneWay = false, Vector2? autotileCoord = default(Vector2?))

    public OccluderPolygon2D TileGetLightOccluder(int id)

Return the light occluder of the tile.

    public ShaderMaterial TileGetMaterial(int id)

Return the material of the tile.

    public string TileGetName(int id)

Return the name of the tile.

    public NavigationPolygon TileGetNavigationPolygon(int id)

Return the navigation polygon of the tile.

    public Vector2 TileGetNavigationPolygonOffset(int id)

Return the offset of the tile’s navigation polygon.

    public Texture TileGetNormalMap(int id)

    public Vector2 TileGetOccluderOffset(int id)

Return the offset of the tile’s light occluder.

    public Rect2 TileGetRegion(int id)

Return the tile sub-region in the texture.

    public Shape2D TileGetShape(int id, int shapeId)

    public int TileGetShapeCount(int id)

    public bool TileGetShapeOneWay(int id, int shapeId)

    public object[] TileGetShapes(int id)

Return the array of shapes of the tile.

    public Transform2D TileGetShapeTransform(int id, int shapeId)

    public Texture TileGetTexture(int id)

Return the texture of the tile.

    public Vector2 TileGetTextureOffset(int id)

Return the texture offset of the tile.

    public void TileSetLightOccluder(int id, OccluderPolygon2D lightOccluder)

Set a light occluder for the tile.

    public void TileSetMaterial(int id, ShaderMaterial material)

Set the material of the tile.

    public void TileSetName(int id, string name)

Set the name of the tile, for descriptive purposes.

    public void TileSetNavigationPolygon(int id, NavigationPolygon navigationPolygon)

Set a navigation polygon for the tile.

    public void TileSetNavigationPolygonOffset(int id, Vector2 navigationPolygonOffset)

Set an offset for the tile’s navigation polygon.

    public void TileSetNormalMap(int id, Texture normalMap)

    public void TileSetOccluderOffset(int id, Vector2 occluderOffset)

Set an offset for the tile’s light occluder.

    public void TileSetRegion(int id, Rect2 region)

Set the tile sub-region in the texture. This is common in texture atlases.

    public void TileSetShape(int id, int shapeId, Shape2D shape)

    public void TileSetShapeOneWay(int id, int shapeId, bool oneWay)

    public void TileSetShapes(int id, object[] shapes)

Set an array of shapes for the tile, enabling physics to collide with it.

    public void TileSetShapeTransform(int id, int shapeId, Transform2D shapeTransform)

    public void TileSetTexture(int id, Texture texture)

Set the texture of the tile.

    public void TileSetTextureOffset(int id, Vector2 textureOffset)

Set the texture offset of the tile.

Inner Types

AutotileBindings

Name Value Description
Topleft 1  
Top 2  
Topright 4  
Left 8  
Right 32  
Bottomleft 64  
Bottom 128  
Bottomright 256  

BitmaskMode

Name Value Description
Bitmask2x2    
Bitmask3x3    
Tags: