Documentation
¶
Overview ¶
graphics.gd/classdb/TileData object represents a single tile in a graphics.gd/classdb/TileSet. It is usually edited using the tileset editor, but it can be modified at runtime using graphics.gd/classdb/TileMapLayer.Instance.TileDataRuntimeUpdate.
Index ¶
- type Advanced
- type Any
- type Expanded
- func (self Expanded) GetNavigationPolygon(layer_id int, flip_h bool, flip_v bool, transpose bool) NavigationPolygon.Instance
- func (self Expanded) GetOccluder(layer_id int, flip_h bool, flip_v bool, transpose bool) OccluderPolygon2D.Instance
- func (self Expanded) GetOccluderPolygon(layer_id int, polygon_index int, flip_h bool, flip_v bool, transpose bool) OccluderPolygon2D.Instance
- type Extension
- type ID
- type Instance
- func (self Instance) AddCollisionPolygon(layer_id int)
- func (self Instance) AddOccluderPolygon(layer_id int)
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsTileData() Instance
- func (self Instance) FlipH() bool
- func (self Instance) FlipV() bool
- func (self Instance) GetCollisionPolygonOneWayMargin(layer_id int, polygon_index int) Float.X
- func (self Instance) GetCollisionPolygonPoints(layer_id int, polygon_index int) []Vector2.XY
- func (self Instance) GetCollisionPolygonsCount(layer_id int) int
- func (self Instance) GetConstantAngularVelocity(layer_id int) Float.X
- func (self Instance) GetConstantLinearVelocity(layer_id int) Vector2.XY
- func (self Instance) GetCustomData(layer_name string) any
- func (self Instance) GetCustomDataByLayerId(layer_id int) any
- func (self Instance) GetNavigationPolygon(layer_id int) NavigationPolygon.Instance
- func (self Instance) GetOccluder(layer_id int) OccluderPolygon2D.Instance
- func (self Instance) GetOccluderPolygon(layer_id int, polygon_index int) OccluderPolygon2D.Instance
- func (self Instance) GetOccluderPolygonsCount(layer_id int) int
- func (self Instance) GetTerrainPeeringBit(peering_bit TileSet.CellNeighbor) int
- func (self Instance) HasCustomData(layer_name string) bool
- func (self Instance) ID() ID
- func (self Instance) IsCollisionPolygonOneWay(layer_id int, polygon_index int) bool
- func (self Instance) IsValidTerrainPeeringBit(peering_bit TileSet.CellNeighbor) bool
- func (self Instance) Material() Material.Instance
- func (self Instance) Modulate() Color.RGBA
- func (self Instance) OnChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) Probability() Float.X
- func (self Instance) RemoveCollisionPolygon(layer_id int, polygon_index int)
- func (self Instance) RemoveOccluderPolygon(layer_id int, polygon_index int)
- func (self Instance) SetCollisionPolygonOneWay(layer_id int, polygon_index int, one_way bool)
- func (self Instance) SetCollisionPolygonOneWayMargin(layer_id int, polygon_index int, one_way_margin Float.X)
- func (self Instance) SetCollisionPolygonPoints(layer_id int, polygon_index int, polygon []Vector2.XY)
- func (self Instance) SetCollisionPolygonsCount(layer_id int, polygons_count int)
- func (self Instance) SetConstantAngularVelocity(layer_id int, velocity Float.X)
- func (self Instance) SetConstantLinearVelocity(layer_id int, velocity Vector2.XY)
- func (self Instance) SetCustomData(layer_name string, value any)
- func (self Instance) SetCustomDataByLayerId(layer_id int, value any)
- func (self Instance) SetFlipH(value bool)
- func (self Instance) SetFlipV(value bool)
- func (self Instance) SetMaterial(value Material.Instance)
- func (self Instance) SetModulate(value Color.RGBA)
- func (self Instance) SetNavigationPolygon(layer_id int, navigation_polygon NavigationPolygon.Instance)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOccluder(layer_id int, occluder_polygon OccluderPolygon2D.Instance)
- func (self Instance) SetOccluderPolygon(layer_id int, polygon_index int, polygon OccluderPolygon2D.Instance)
- func (self Instance) SetOccluderPolygonsCount(layer_id int, polygons_count int)
- func (self Instance) SetProbability(value Float.X)
- func (self Instance) SetTerrain(value int)
- func (self Instance) SetTerrainPeeringBit(peering_bit TileSet.CellNeighbor, terrain int)
- func (self Instance) SetTerrainSet(value int)
- func (self Instance) SetTextureOrigin(value Vector2i.XY)
- func (self Instance) SetTranspose(value bool)
- func (self Instance) SetYSortOrigin(value int)
- func (self Instance) SetZIndex(value int)
- func (self Instance) Terrain() int
- func (self Instance) TerrainSet() int
- func (self Instance) TextureOrigin() Vector2i.XY
- func (self Instance) Transpose() bool
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) YSortOrigin() int
- func (self Instance) ZIndex() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Expanded ¶
func (Expanded) GetNavigationPolygon ¶
func (self Expanded) GetNavigationPolygon(layer_id int, flip_h bool, flip_v bool, transpose bool) NavigationPolygon.Instance
Returns the navigation polygon of the tile for the TileSet navigation layer with index 'layer_id'.
'flip_h', 'flip_v', and 'transpose' allow transforming the returned polygon.
func (Expanded) GetOccluder ¶
func (self Expanded) GetOccluder(layer_id int, flip_h bool, flip_v bool, transpose bool) OccluderPolygon2D.Instance
Returns the occluder polygon of the tile for the TileSet occlusion layer with index 'layer_id'.
'flip_h', 'flip_v', and 'transpose' allow transforming the returned polygon.
func (Expanded) GetOccluderPolygon ¶
func (self Expanded) GetOccluderPolygon(layer_id int, polygon_index int, flip_h bool, flip_v bool, transpose bool) OccluderPolygon2D.Instance
Returns the occluder polygon at index 'polygon_index' from the TileSet occlusion layer with index 'layer_id'.
The 'flip_h', 'flip_v', and 'transpose' parameters can be true to transform the returned polygon.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsTileData ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddCollisionPolygon ¶
Adds a collision polygon to the tile on the given TileSet physics layer.
func (Instance) AddOccluderPolygon ¶
Adds an occlusion polygon to the tile on the TileSet occlusion layer with index 'layer_id'.
func (Instance) AsTileData ¶
func (Instance) GetCollisionPolygonOneWayMargin ¶
Returns the one-way margin (for one-way platforms) of the polygon at index 'polygon_index' for TileSet physics layer with index 'layer_id'.
func (Instance) GetCollisionPolygonPoints ¶
Returns the points of the polygon at index 'polygon_index' for TileSet physics layer with index 'layer_id'.
func (Instance) GetCollisionPolygonsCount ¶
Returns how many polygons the tile has for TileSet physics layer with index 'layer_id'.
func (Instance) GetConstantAngularVelocity ¶
Returns the constant angular velocity applied to objects colliding with this tile.
func (Instance) GetConstantLinearVelocity ¶
Returns the constant linear velocity applied to objects colliding with this tile.
func (Instance) GetCustomData ¶
Returns the custom data value for custom data layer named 'layer_name'. To check if a custom data layer exists, use Instance.HasCustomData.
func (Instance) GetCustomDataByLayerId ¶
Returns the custom data value for custom data layer with index 'layer_id'.
func (Instance) GetNavigationPolygon ¶
func (self Instance) GetNavigationPolygon(layer_id int) NavigationPolygon.Instance
Returns the navigation polygon of the tile for the TileSet navigation layer with index 'layer_id'.
'flip_h', 'flip_v', and 'transpose' allow transforming the returned polygon.
func (Instance) GetOccluder ¶
func (self Instance) GetOccluder(layer_id int) OccluderPolygon2D.Instance
Returns the occluder polygon of the tile for the TileSet occlusion layer with index 'layer_id'.
'flip_h', 'flip_v', and 'transpose' allow transforming the returned polygon.
func (Instance) GetOccluderPolygon ¶
func (self Instance) GetOccluderPolygon(layer_id int, polygon_index int) OccluderPolygon2D.Instance
Returns the occluder polygon at index 'polygon_index' from the TileSet occlusion layer with index 'layer_id'.
The 'flip_h', 'flip_v', and 'transpose' parameters can be true to transform the returned polygon.
func (Instance) GetOccluderPolygonsCount ¶
Returns the number of occluder polygons of the tile in the TileSet occlusion layer with index 'layer_id'.
func (Instance) GetTerrainPeeringBit ¶
func (self Instance) GetTerrainPeeringBit(peering_bit TileSet.CellNeighbor) int
Returns the tile's terrain bit for the given 'peering_bit' direction. To check that a direction is valid, use Instance.IsValidTerrainPeeringBit.
func (Instance) HasCustomData ¶
Returns whether there exists a custom data layer named 'layer_name'.
func (Instance) IsCollisionPolygonOneWay ¶
Returns whether one-way collisions are enabled for the polygon at index 'polygon_index' for TileSet physics layer with index 'layer_id'.
func (Instance) IsValidTerrainPeeringBit ¶
func (self Instance) IsValidTerrainPeeringBit(peering_bit TileSet.CellNeighbor) bool
Returns whether the given 'peering_bit' direction is valid for this tile.
func (Instance) Probability ¶
func (Instance) RemoveCollisionPolygon ¶
Removes the polygon at index 'polygon_index' for TileSet physics layer with index 'layer_id'.
func (Instance) RemoveOccluderPolygon ¶
Removes the polygon at index 'polygon_index' for TileSet occlusion layer with index 'layer_id'.
func (Instance) SetCollisionPolygonOneWay ¶
Enables/disables one-way collisions on the polygon at index 'polygon_index' for TileSet physics layer with index 'layer_id'.
func (Instance) SetCollisionPolygonOneWayMargin ¶
func (self Instance) SetCollisionPolygonOneWayMargin(layer_id int, polygon_index int, one_way_margin Float.X)
Sets the one-way margin (for one-way platforms) of the polygon at index 'polygon_index' for TileSet physics layer with index 'layer_id'.
func (Instance) SetCollisionPolygonPoints ¶
func (self Instance) SetCollisionPolygonPoints(layer_id int, polygon_index int, polygon []Vector2.XY)
Sets the points of the polygon at index 'polygon_index' for TileSet physics layer with index 'layer_id'.
func (Instance) SetCollisionPolygonsCount ¶
Sets the polygons count for TileSet physics layer with index 'layer_id'.
func (Instance) SetConstantAngularVelocity ¶
Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile.
func (Instance) SetConstantLinearVelocity ¶
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.
func (Instance) SetCustomData ¶
Sets the tile's custom data value for the TileSet custom data layer with name 'layer_name'.
func (Instance) SetCustomDataByLayerId ¶
Sets the tile's custom data value for the TileSet custom data layer with index 'layer_id'.
func (Instance) SetMaterial ¶
func (Instance) SetModulate ¶
func (Instance) SetNavigationPolygon ¶
func (self Instance) SetNavigationPolygon(layer_id int, navigation_polygon NavigationPolygon.Instance)
Sets the navigation polygon for the TileSet navigation layer with index 'layer_id'.
func (Instance) SetOccluder ¶
func (self Instance) SetOccluder(layer_id int, occluder_polygon OccluderPolygon2D.Instance)
Sets the occluder for the TileSet occlusion layer with index 'layer_id'.
func (Instance) SetOccluderPolygon ¶
func (self Instance) SetOccluderPolygon(layer_id int, polygon_index int, polygon OccluderPolygon2D.Instance)
Sets the occluder for polygon with index 'polygon_index' in the TileSet occlusion layer with index 'layer_id'.
func (Instance) SetOccluderPolygonsCount ¶
Sets the occluder polygon count in the TileSet occlusion layer with index 'layer_id'.
func (Instance) SetProbability ¶
func (Instance) SetTerrain ¶
func (Instance) SetTerrainPeeringBit ¶
func (self Instance) SetTerrainPeeringBit(peering_bit TileSet.CellNeighbor, terrain int)
Sets the tile's terrain bit for the given 'peering_bit' direction. To check that a direction is valid, use Instance.IsValidTerrainPeeringBit.