TileData

package
v0.0.0-...-5eaf078 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package TileData provides methods for working with TileData object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsTileData() Instance
}

type Expanded

type Expanded [1]gdclass.TileData

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 [param layer_id]. [param flip_h], [param flip_v], and [param 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 [param layer_id]. [param flip_h], [param flip_v], and [param 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 [param polygon_index] from the TileSet occlusion layer with index [param layer_id]. The [param flip_h], [param flip_v], and [param transpose] parameters can be [code]true[/code] to transform the returned polygon.

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsTileData

func (self *Extension[T]) AsTileData() Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.TileData

[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 New

func New() Instance

func (Instance) AddCollisionPolygon

func (self Instance) AddCollisionPolygon(layer_id int)

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

func (Instance) AddOccluderPolygon

func (self Instance) AddOccluderPolygon(layer_id int)

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

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsTileData

func (self Instance) AsTileData() Instance

func (Instance) FlipH

func (self Instance) FlipH() bool

func (Instance) FlipV

func (self Instance) FlipV() bool

func (Instance) GetCollisionPolygonOneWayMargin

func (self Instance) GetCollisionPolygonOneWayMargin(layer_id int, polygon_index int) Float.X

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

func (self Instance) GetCollisionPolygonPoints(layer_id int, polygon_index int) []Vector2.XY

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

func (Instance) GetCollisionPolygonsCount

func (self Instance) GetCollisionPolygonsCount(layer_id int) int

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

func (Instance) GetConstantAngularVelocity

func (self Instance) GetConstantAngularVelocity(layer_id int) Float.X

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

func (Instance) GetConstantLinearVelocity

func (self Instance) GetConstantLinearVelocity(layer_id int) Vector2.XY

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

func (Instance) GetCustomData

func (self Instance) GetCustomData(layer_name string) any

Returns the custom data value for custom data layer named [param layer_name]. To check if a custom data layer exists, use [method has_custom_data].

func (Instance) GetCustomDataByLayerId

func (self Instance) GetCustomDataByLayerId(layer_id int) any

Returns the custom data value for custom data layer with index [param 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 [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) OccluderPolygon2D.Instance

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) GetOccluderPolygon

func (self Instance) GetOccluderPolygon(layer_id int, polygon_index int) OccluderPolygon2D.Instance

Returns the occluder polygon at index [param polygon_index] from the TileSet occlusion layer with index [param layer_id]. The [param flip_h], [param flip_v], and [param transpose] parameters can be [code]true[/code] to transform the returned polygon.

func (Instance) GetOccluderPolygonsCount

func (self Instance) GetOccluderPolygonsCount(layer_id int) int

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

func (Instance) GetTerrainPeeringBit

func (self Instance) GetTerrainPeeringBit(peering_bit TileSet.CellNeighbor) 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) HasCustomData

func (self Instance) HasCustomData(layer_name string) bool

Returns whether there exists a custom data layer named [param layer_name].

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsCollisionPolygonOneWay

func (self Instance) IsCollisionPolygonOneWay(layer_id int, polygon_index int) bool

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 TileSet.CellNeighbor) bool

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

func (Instance) Material

func (self Instance) Material() Material.Instance

func (Instance) Modulate

func (self Instance) Modulate() Color.RGBA

func (Instance) OnChanged

func (self Instance) OnChanged(cb func(), flags ...Signal.Flags)

func (Instance) Probability

func (self Instance) Probability() Float.X

func (Instance) RemoveCollisionPolygon

func (self Instance) RemoveCollisionPolygon(layer_id int, polygon_index int)

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

func (Instance) RemoveOccluderPolygon

func (self Instance) RemoveOccluderPolygon(layer_id int, polygon_index int)

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

func (Instance) SetCollisionPolygonOneWay

func (self Instance) SetCollisionPolygonOneWay(layer_id int, polygon_index int, one_way bool)

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)

Sets 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) 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

func (self Instance) SetCollisionPolygonsCount(layer_id int, polygons_count int)

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

func (Instance) SetConstantAngularVelocity

func (self Instance) SetConstantAngularVelocity(layer_id int, velocity Float.X)

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

func (self Instance) SetConstantLinearVelocity(layer_id int, velocity Vector2.XY)

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

func (self Instance) SetCustomData(layer_name string, value any)

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

func (Instance) SetCustomDataByLayerId

func (self Instance) SetCustomDataByLayerId(layer_id int, value any)

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

func (Instance) SetFlipH

func (self Instance) SetFlipH(value bool)

func (Instance) SetFlipV

func (self Instance) SetFlipV(value bool)

func (Instance) SetMaterial

func (self Instance) SetMaterial(value Material.Instance)

func (Instance) SetModulate

func (self Instance) SetModulate(value Color.RGBA)

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 [param layer_id].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOccluder

func (self Instance) SetOccluder(layer_id int, occluder_polygon OccluderPolygon2D.Instance)

Sets the occluder for the TileSet occlusion layer with index [param 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 [param polygon_index] in the TileSet occlusion layer with index [param layer_id].

func (Instance) SetOccluderPolygonsCount

func (self Instance) SetOccluderPolygonsCount(layer_id int, polygons_count int)

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

func (Instance) SetProbability

func (self Instance) SetProbability(value Float.X)

func (Instance) SetTerrain

func (self Instance) SetTerrain(value int)

func (Instance) SetTerrainPeeringBit

func (self Instance) SetTerrainPeeringBit(peering_bit TileSet.CellNeighbor, 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].

func (Instance) SetTerrainSet

func (self Instance) SetTerrainSet(value int)

func (Instance) SetTextureOrigin

func (self Instance) SetTextureOrigin(value Vector2i.XY)

func (Instance) SetTranspose

func (self Instance) SetTranspose(value bool)

func (Instance) SetYSortOrigin

func (self Instance) SetYSortOrigin(value int)

func (Instance) SetZIndex

func (self Instance) SetZIndex(value int)

func (Instance) Terrain

func (self Instance) Terrain() int

func (Instance) TerrainSet

func (self Instance) TerrainSet() int

func (Instance) TextureOrigin

func (self Instance) TextureOrigin() Vector2i.XY

func (Instance) Transpose

func (self Instance) Transpose() bool

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) YSortOrigin

func (self Instance) YSortOrigin() int

func (Instance) ZIndex

func (self Instance) ZIndex() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL