Documentation
¶
Overview ¶
Package TileData provides methods for working with TileData object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AddCollisionPolygon(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) [1]gdclass.NavigationPolygon
- func (self Instance) GetOccluder(layer_id int) [1]gdclass.OccluderPolygon2D
- func (self Instance) GetTerrainPeeringBit(peering_bit gdclass.TileSetCellNeighbor) int
- func (self Instance) IsCollisionPolygonOneWay(layer_id int, polygon_index int) bool
- func (self Instance) IsValidTerrainPeeringBit(peering_bit gdclass.TileSetCellNeighbor) bool
- func (self Instance) Material() [1]gdclass.Material
- func (self Instance) Modulate() Color.RGBA
- func (self Instance) OnChanged(cb func())
- func (self Instance) Probability() Float.X
- func (self Instance) RemoveCollisionPolygon(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 [1]gdclass.Material)
- func (self Instance) SetModulate(value Color.RGBA)
- func (self Instance) SetNavigationPolygon(layer_id int, navigation_polygon [1]gdclass.NavigationPolygon)
- func (self Instance) SetOccluder(layer_id int, occluder_polygon [1]gdclass.OccluderPolygon2D)
- func (self Instance) SetProbability(value Float.X)
- func (self Instance) SetTerrain(value int)
- func (self Instance) SetTerrainPeeringBit(peering_bit gdclass.TileSetCellNeighbor, 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) UnsafePointer() unsafe.Pointer
- 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 Instance ¶
[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 [method TileMap._tile_data_runtime_update].
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) AsTileData ¶
func (Instance) GetCollisionPolygonOneWayMargin ¶
Returns the one-way margin (for one-way platforms) of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
func (Instance) GetCollisionPolygonPoints ¶
Returns the points of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
func (Instance) GetCollisionPolygonsCount ¶
Returns how many polygons the tile has for TileSet physics layer with index [param 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 [param layer_name].
func (Instance) GetCustomDataByLayerId ¶
Returns the custom data value for custom data layer with index [param layer_id].
func (Instance) GetNavigationPolygon ¶
func (self Instance) GetNavigationPolygon(layer_id int) [1]gdclass.NavigationPolygon
Returns the navigation polygon of the tile for the TileSet navigation layer with index [param layer_id]. [param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon.
func (Instance) GetOccluder ¶
func (self Instance) GetOccluder(layer_id int) [1]gdclass.OccluderPolygon2D
Returns the occluder polygon of the tile for the TileSet occlusion layer with index [param layer_id]. [param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon.
func (Instance) GetTerrainPeeringBit ¶
func (self Instance) GetTerrainPeeringBit(peering_bit gdclass.TileSetCellNeighbor) int
Returns the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit].
func (Instance) IsCollisionPolygonOneWay ¶
Returns whether one-way collisions are enabled for the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
func (Instance) IsValidTerrainPeeringBit ¶
func (self Instance) IsValidTerrainPeeringBit(peering_bit gdclass.TileSetCellNeighbor) bool
Returns whether the given [param peering_bit] direction is valid for this tile.
func (Instance) Probability ¶
func (Instance) RemoveCollisionPolygon ¶
Removes the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
func (Instance) SetCollisionPolygonOneWay ¶
Enables/disables one-way collisions on the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
func (Instance) SetCollisionPolygonOneWayMargin ¶
func (self Instance) SetCollisionPolygonOneWayMargin(layer_id int, polygon_index int, one_way_margin Float.X)
Enables/disables one-way collisions on the polygon at index [param polygon_index] for TileSet physics layer with index [param 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 [param polygon_index] for TileSet physics layer with index [param layer_id].
func (Instance) SetCollisionPolygonsCount ¶
Sets the polygons count for TileSet physics layer with index [param 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 [param layer_name].
func (Instance) SetCustomDataByLayerId ¶
Sets the tile's custom data value for the TileSet custom data layer with index [param layer_id].
func (Instance) SetMaterial ¶
func (Instance) SetModulate ¶
func (Instance) SetNavigationPolygon ¶
func (self Instance) SetNavigationPolygon(layer_id int, navigation_polygon [1]gdclass.NavigationPolygon)
Sets the navigation polygon for the TileSet navigation layer with index [param layer_id].
func (Instance) SetOccluder ¶
func (self Instance) SetOccluder(layer_id int, occluder_polygon [1]gdclass.OccluderPolygon2D)
Sets the occluder for the TileSet occlusion layer with index [param layer_id].
func (Instance) SetProbability ¶
func (Instance) SetTerrain ¶
func (Instance) SetTerrainPeeringBit ¶
func (self Instance) SetTerrainPeeringBit(peering_bit gdclass.TileSetCellNeighbor, terrain int)
Sets the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit].