reckfellENGINE

TileData

Settings for a single tile in a TileSet.

On this page
class TileDataReckfellSharpInherits ReckfellObject

Settings for a single tile in a TileSet.

TileData object represents a single tile in a TileSet. It is usually edited using the tileset editor, but it can be modified at runtime using TileMapLayer._TileDataRuntimeUpdate.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

TileDataConstructor
# TileData
C#
public TileData();

Properties11

FlipHProperty
# FlipH
C#
public bool FlipH { get; set; }

If true, the tile will have its texture flipped horizontally.

FlipVProperty
# FlipV
C#
public bool FlipV { get; set; }

If true, the tile will have its texture flipped vertically.

MaterialProperty
# Material
C#
public Material Material { get; set; }

The Material to use for this TileData. This can be a CanvasItemMaterial to use the default shader, or a ShaderMaterial to use a custom shader.

ModulateProperty
# Modulate
C#
public Color Modulate { get; set; }

Color modulation of the tile.

ProbabilityProperty
# Probability
C#
public float Probability { get; set; }

Relative probability of this tile being selected when drawing a pattern of random tiles.

TerrainProperty
# Terrain
C#
public int Terrain { get; set; }

ID of the terrain from the terrain set that the tile uses.

TerrainSetProperty
# TerrainSet
C#
public int TerrainSet { get; set; }

ID of the terrain set that the tile uses.

TextureOriginProperty
# TextureOrigin
C#
public Vector2I TextureOrigin { get; set; }

Offsets the position of where the tile is drawn.

TransposeProperty
# Transpose
C#
public bool Transpose { get; set; }

If true, the tile will display transposed, i.e. with horizontal and vertical texture UVs swapped.

YSortOriginProperty
# YSortOrigin
C#
public int YSortOrigin { get; set; }

Vertical point of the tile used for determining y-sorted order.

ZIndexProperty
# ZIndex
C#
public int ZIndex { get; set; }

Ordering index of this tile, relative to TileMapLayer.

Methods57

AddCollisionPolygonvoid
# AddCollisionPolygon
C#
public void AddCollisionPolygon(int layerId);

Adds a collision polygon to the tile on the given TileSet physics layer.

Parameters
NameTypeDefault
layerIdint—
AddOccluderPolygonvoid
# AddOccluderPolygon
C#
public void AddOccluderPolygon(int layerId);

Adds an occlusion polygon to the tile on the TileSet occlusion layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
GetCollisionPolygonOneWayMarginfloat
# GetCollisionPolygonOneWayMargin
C#
public float GetCollisionPolygonOneWayMargin(int layerId, int polygonIndex);

Returns the one-way margin (for one-way platforms) of the polygon at index polygon_index for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
Returns float
GetCollisionPolygonPointsVector2[]
# GetCollisionPolygonPoints
C#
public Vector2[] GetCollisionPolygonPoints(int layerId, int polygonIndex);

Returns the points of the polygon at index polygon_index for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
Returns Vector2[]
GetCollisionPolygonsCountint
# GetCollisionPolygonsCount
C#
public int GetCollisionPolygonsCount(int layerId);

Returns how many polygons the tile has for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
Returns int
GetConstantAngularVelocityfloat
# GetConstantAngularVelocity
C#
public float GetConstantAngularVelocity(int layerId);

Returns the constant angular velocity applied to objects colliding with this tile.

Parameters
NameTypeDefault
layerIdint—
Returns float
GetConstantLinearVelocityVector2
# GetConstantLinearVelocity
C#
public Vector2 GetConstantLinearVelocity(int layerId);

Returns the constant linear velocity applied to objects colliding with this tile.

Parameters
NameTypeDefault
layerIdint—
Returns Vector2
GetCustomDataVariant
# GetCustomData
C#
public Variant GetCustomData(string layerName);

Reads a Variant from a named TileSet custom-data layer. Define the layer and its type in TileSet first. This is tile-type metadata; a walkable value does not itself enable navigation or disable physics shapes.

Parameters
NameTypeDefault
layerNamestring—
layerName

Exact name of an existing custom-data layer, not a cell ID. Use HasCustomData when existence is uncertain.

Returns Variant

The Variant value. Use AsBool for the sample boolean layer after validating data. A missing name reports an engine error and returns Nil; do not silently treat Nil as valid false.

GetCustomDataByLayerIdVariant
# GetCustomDataByLayerId
C#
public Variant GetCustomDataByLayerId(int layerId);

Returns the custom data value for custom data layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
Returns Variant
GetFlipHbool
# GetFlipH
C#
public bool GetFlipH();
Returns bool
GetFlipVbool
# GetFlipV
C#
public bool GetFlipV();
Returns bool
GetMaterialMaterial
# GetMaterial
C#
public Material GetMaterial();
Returns Material
GetModulateColor
# GetModulate
C#
public Color GetModulate();
Returns Color
GetNavigationPolygon2 overloads
# GetNavigationPolygon · 1/2
C#
public NavigationPolygon GetNavigationPolygon(int _UnnamedArg0);

Returns the navigation polygon of the tile for the TileSet navigation layer with index layer_id. TileData.FlipH, TileData.FlipV, and TileData.Transpose allow transforming the returned polygon.

Parameters
NameTypeDefault
_UnnamedArg0int—
Returns NavigationPolygon
# GetNavigationPolygon · 2/2
C#
public NavigationPolygon GetNavigationPolygon(int layerId, bool flipH = false, bool flipV = false, bool transpose = false);

Returns the navigation polygon of the tile for the TileSet navigation layer with index layer_id. TileData.FlipH, TileData.FlipV, and TileData.Transpose allow transforming the returned polygon.

Parameters
NameTypeDefault
layerIdint—
flipHboolfalse
flipVboolfalse
transposeboolfalse
Returns NavigationPolygon
GetOccluder2 overloads · Includes deprecated
# GetOccluder · 1/2
C#
public OccluderPolygon2D GetOccluder(int _UnnamedArg0);

Returns the occluder polygon of the tile for the TileSet occlusion layer with index layer_id. TileData.FlipH, TileData.FlipV, and TileData.Transpose allow transforming the returned polygon.

Parameters
NameTypeDefault
_UnnamedArg0int—
Returns OccluderPolygon2D
# GetOccluder · 2/2
C#
public OccluderPolygon2D GetOccluder(int layerId, bool flipH = false, bool flipV = false, bool transpose = false);

Returns the occluder polygon of the tile for the TileSet occlusion layer with index layer_id. TileData.FlipH, TileData.FlipV, and TileData.Transpose allow transforming the returned polygon.

Parameters
NameTypeDefault
layerIdint—
flipHboolfalse
flipVboolfalse
transposeboolfalse
Returns OccluderPolygon2D
GetOccluderPolygonOccluderPolygon2D
# GetOccluderPolygon
C#
public OccluderPolygon2D GetOccluderPolygon(int layerId, int polygonIndex, bool flipH = false, bool flipV = false, bool transpose = false);

Returns the occluder polygon at index polygon_index from the TileSet occlusion layer with index layer_id. The TileData.FlipH, TileData.FlipV, and TileData.Transpose parameters can be true to transform the returned polygon.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
flipHboolfalse
flipVboolfalse
transposeboolfalse
Returns OccluderPolygon2D
GetOccluderPolygonsCountint
# GetOccluderPolygonsCount
C#
public int GetOccluderPolygonsCount(int layerId);

Returns the number of occluder polygons of the tile in the TileSet occlusion layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
Returns int
GetProbabilityfloat
# GetProbability
C#
public float GetProbability();
Returns float
GetTerrainint
# GetTerrain
C#
public int GetTerrain();
Returns int
GetTerrainPeeringBitint
# GetTerrainPeeringBit
C#
public int GetTerrainPeeringBit(TileSet.CellNeighbor peeringBit);

Returns the tile's terrain bit for the given peering_bit direction. To check that a direction is valid, use TileData.IsValidTerrainPeeringBit.

Parameters
NameTypeDefault
peeringBitTileSet.CellNeighbor—
Returns int
GetTerrainSetint
# GetTerrainSet
C#
public int GetTerrainSet();
Returns int
GetTextureOriginVector2I
# GetTextureOrigin
C#
public Vector2I GetTextureOrigin();
Returns Vector2I
GetTransposebool
# GetTranspose
C#
public bool GetTranspose();
Returns bool
GetYSortOriginint
# GetYSortOrigin
C#
public int GetYSortOrigin();
Returns int
GetZIndexint
# GetZIndex
C#
public int GetZIndex();
Returns int
HasCustomDatabool
# HasCustomData
C#
public bool HasCustomData(string layerName);

Returns whether there exists a custom data layer named layer_name.

Parameters
NameTypeDefault
layerNamestring—
Returns bool
IsCollisionPolygonOneWaybool
# IsCollisionPolygonOneWay
C#
public bool IsCollisionPolygonOneWay(int layerId, int polygonIndex);

Returns whether one-way collisions are enabled for the polygon at index polygon_index for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
Returns bool
IsValidTerrainPeeringBitbool
# IsValidTerrainPeeringBit
C#
public bool IsValidTerrainPeeringBit(TileSet.CellNeighbor peeringBit);

Returns whether the given peering_bit direction is valid for this tile.

Parameters
NameTypeDefault
peeringBitTileSet.CellNeighbor—
Returns bool
RemoveCollisionPolygonvoid
# RemoveCollisionPolygon
C#
public void RemoveCollisionPolygon(int layerId, int polygonIndex);

Removes the polygon at index polygon_index for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
RemoveOccluderPolygonvoid
# RemoveOccluderPolygon
C#
public void RemoveOccluderPolygon(int layerId, int polygonIndex);

Removes the polygon at index polygon_index for TileSet occlusion layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
SetCollisionPolygonOneWayvoid
# SetCollisionPolygonOneWay
C#
public void SetCollisionPolygonOneWay(int layerId, int polygonIndex, bool oneWay);

Enables/disables one-way collisions on the polygon at index polygon_index for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
oneWaybool—
SetCollisionPolygonOneWayMarginvoid
# SetCollisionPolygonOneWayMargin
C#
public void SetCollisionPolygonOneWayMargin(int layerId, int polygonIndex, float oneWayMargin);

Sets the one-way margin (for one-way platforms) of the polygon at index polygon_index for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
oneWayMarginfloat—
SetCollisionPolygonPoints2 overloads
# SetCollisionPolygonPoints · 1/2
C#
public void SetCollisionPolygonPoints(int layerId, int polygonIndex, Vector2[] polygon);

Sets the points of the polygon at index polygon_index for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
polygonVector2[]—
# SetCollisionPolygonPoints · 2/2
C#
public void SetCollisionPolygonPoints(int layerId, int polygonIndex, ReadOnlySpan<Vector2> polygon);

Sets the points of the polygon at index polygon_index for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
polygonReadOnlySpan<Vector2>—
SetCollisionPolygonsCountvoid
# SetCollisionPolygonsCount
C#
public void SetCollisionPolygonsCount(int layerId, int polygonsCount);

Sets the polygons count for TileSet physics layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonsCountint—
SetConstantAngularVelocityvoid
# SetConstantAngularVelocity
C#
public void SetConstantAngularVelocity(int layerId, float velocity);

Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile.

Parameters
NameTypeDefault
layerIdint—
velocityfloat—
SetConstantLinearVelocityvoid
# SetConstantLinearVelocity
C#
public void SetConstantLinearVelocity(int layerId, Vector2 velocity);

Sets the constant linear velocity. This does not move the tile. This linear velocity is applied to objects colliding with this tile. This is useful to create conveyor belts.

Parameters
NameTypeDefault
layerIdint—
velocityVector2—
SetCustomDatavoid
# SetCustomData
C#
public void SetCustomData(string layerName, Variant value);

Sets the tile's custom data value for the TileSet custom data layer with name layer_name.

Parameters
NameTypeDefault
layerNamestring—
valueVariant—
SetCustomDataByLayerIdvoid
# SetCustomDataByLayerId
C#
public void SetCustomDataByLayerId(int layerId, Variant value);

Sets the tile's custom data value for the TileSet custom data layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
valueVariant—
SetFlipHvoid
# SetFlipH
C#
public void SetFlipH(bool flipH);
Parameters
NameTypeDefault
flipHbool—
SetFlipVvoid
# SetFlipV
C#
public void SetFlipV(bool flipV);
Parameters
NameTypeDefault
flipVbool—
SetMaterialvoid
# SetMaterial
C#
public void SetMaterial(Material material);
Parameters
NameTypeDefault
materialMaterial—
SetModulatevoid
# SetModulate
C#
public void SetModulate(Color modulate);
Parameters
NameTypeDefault
modulateColor—
SetNavigationPolygonvoid
# SetNavigationPolygon
C#
public void SetNavigationPolygon(int layerId, NavigationPolygon navigationPolygon);

Sets the navigation polygon for the TileSet navigation layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
navigationPolygonNavigationPolygon—
SetOccludervoid · Deprecated
# SetOccluder
C#
public void SetOccluder(int layerId, OccluderPolygon2D occluderPolygon);

Sets the occluder for the TileSet occlusion layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
occluderPolygonOccluderPolygon2D—
SetOccluderPolygonvoid
# SetOccluderPolygon
C#
public void SetOccluderPolygon(int layerId, int polygonIndex, OccluderPolygon2D polygon);

Sets the occluder for polygon with index polygon_index in the TileSet occlusion layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonIndexint—
polygonOccluderPolygon2D—
SetOccluderPolygonsCountvoid
# SetOccluderPolygonsCount
C#
public void SetOccluderPolygonsCount(int layerId, int polygonsCount);

Sets the occluder polygon count in the TileSet occlusion layer with index layer_id.

Parameters
NameTypeDefault
layerIdint—
polygonsCountint—
SetProbabilityvoid
# SetProbability
C#
public void SetProbability(float probability);
Parameters
NameTypeDefault
probabilityfloat—
SetTerrainvoid
# SetTerrain
C#
public void SetTerrain(int terrain);
Parameters
NameTypeDefault
terrainint—
SetTerrainPeeringBitvoid
# SetTerrainPeeringBit
C#
public void SetTerrainPeeringBit(TileSet.CellNeighbor peeringBit, int terrain);

Sets the tile's terrain bit for the given peering_bit direction. To check that a direction is valid, use TileData.IsValidTerrainPeeringBit.

Parameters
NameTypeDefault
peeringBitTileSet.CellNeighbor—
terrainint—
SetTerrainSetvoid
# SetTerrainSet
C#
public void SetTerrainSet(int terrainSet);
Parameters
NameTypeDefault
terrainSetint—
SetTextureOriginvoid
# SetTextureOrigin
C#
public void SetTextureOrigin(Vector2I textureOrigin);
Parameters
NameTypeDefault
textureOriginVector2I—
SetTransposevoid
# SetTranspose
C#
public void SetTranspose(bool transpose);
Parameters
NameTypeDefault
transposebool—
SetYSortOriginvoid
# SetYSortOrigin
C#
public void SetYSortOrigin(int ySortOrigin);
Parameters
NameTypeDefault
ySortOriginint—
SetZIndexvoid
# SetZIndex
C#
public void SetZIndex(int zIndex);
Parameters
NameTypeDefault
zIndexint—

Signals and events1

ChangedEvent
# Changed
C#
public event Action Changed;

Emitted when any of the properties are changed.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.