TileData

package
v0.0.0-...-01268d7 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 22 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 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) 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].

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

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 gdclass.TileSetCellNeighbor) bool

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

func (Instance) Material

func (self Instance) Material() [1]gdclass.Material

func (Instance) Modulate

func (self Instance) Modulate() Color.RGBA

func (Instance) OnChanged

func (self Instance) OnChanged(cb func())

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

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

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 [1]gdclass.Material)

func (Instance) SetModulate

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

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 (self Instance) SetProbability(value Float.X)

func (Instance) SetTerrain

func (self Instance) SetTerrain(value int)

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].

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