TileMapPattern
Holds a pattern to be copied from or pasted into TileMap
s.
class TileMapPattern
This resource holds a set of cells to help bulk manipulations of TileMap
.
A pattern always start at the (0,0)
coordinates and cannot have cells with negative coordinates.
Superclasses
class Resource
Base class for serializable objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func getCellAlternativeTile(coords: Vector2i
) -> Int32 Returns the tile alternative ID of the cell at
coords
.func getCellAtlasCoords(Vector2i
) -> Vector2i Returns the tile atlas coordinates ID of the cell at
coords
.func getCellSourceId(coords: Vector2i
) -> Int32 Returns the tile source ID of the cell at
coords
.func getSize(
) -> Vector2i Returns the size, in cells, of the pattern.
func getUsedCells(
) -> VariantCollection<Vector2i> Returns the list of used cell coordinates in the pattern.
func hasCell(coords: Vector2i
) -> Bool Returns whether the pattern has a tile at the given coordinates.
func isEmpty(
) -> Bool Returns whether the pattern is empty or not.
func removeCell(coords: Vector2i, updateSize: Bool
) Remove the cell at the given coordinates.
func setCell(coords: Vector2i, sourceId: Int32, atlasCoords: Vector2i, alternativeTile: Int32
) Sets the tile identifiers for the cell at coordinates
coords
. SeesetCell(layer:coords:sourceId:atlasCoords:alternativeTile:)
.func setSize(Vector2i
) Sets the size of the pattern.