TileSetSource

package
v0.0.0-...-c909628 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package TileSetSource provides methods for working with TileSetSource 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
	AsTileSetSource() Instance
}

type Instance

type Instance [1]gdclass.TileSetSource

Exposes a set of tiles for a [TileSet] resource. Tiles in a source are indexed with two IDs, coordinates ID (of type Vector2i) and an alternative ID (of type int), named according to their use in the [TileSetAtlasSource] class. Depending on the TileSet source type, those IDs might have restrictions on their values, this is why the base [TileSetSource] class only exposes getters for them. You can iterate over all tiles exposed by a TileSetSource by first iterating over coordinates IDs using [method get_tiles_count] and [method get_tile_id], then over alternative IDs using [method get_alternative_tiles_count] and [method get_alternative_tile_id]. [b]Warning:[/b] [TileSetSource] can only be added to one TileSet at the same time. Calling [method TileSet.add_source] on a second [TileSet] will remove the source from the first one.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsObject

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

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsTileSetSource

func (self Instance) AsTileSetSource() Instance

func (Instance) GetAlternativeTileId

func (self Instance) GetAlternativeTileId(atlas_coords Vector2i.XY, index int) int

Returns the alternative ID for the tile with coordinates ID [param atlas_coords] at index [param index].

func (Instance) GetAlternativeTilesCount

func (self Instance) GetAlternativeTilesCount(atlas_coords Vector2i.XY) int

Returns the number of alternatives tiles for the coordinates ID [param atlas_coords]. For [TileSetAtlasSource], this always return at least 1, as the base tile with ID 0 is always part of the alternatives list. Returns -1 if there is not tile at the given coords.

func (Instance) GetTileId

func (self Instance) GetTileId(index int) Vector2i.XY

Returns the tile coordinates ID of the tile with index [param index].

func (Instance) GetTilesCount

func (self Instance) GetTilesCount() int

Returns how many tiles this atlas source defines (not including alternative tiles).

func (Instance) HasAlternativeTile

func (self Instance) HasAlternativeTile(atlas_coords Vector2i.XY, alternative_tile int) bool

Returns if the base tile at coordinates [param atlas_coords] has an alternative with ID [param alternative_tile].

func (Instance) HasTile

func (self Instance) HasTile(atlas_coords Vector2i.XY) bool

Returns if this atlas has a tile with coordinates ID [param atlas_coords].

func (*Instance) UnsafePointer

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

func (Instance) Virtual

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

Jump to

Keyboard shortcuts

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