TileSetAtlasSource

    Exposes a 2D atlas texture as a set of tiles for a TileSet resource.

    TileSetAtlasSource.swift:26
    class TileSetAtlasSource

    An atlas is a grid of tiles laid out on a texture. Each tile in the grid must be exposed using createTile(atlasCoords:size:). Those tiles are then indexed using their coordinates in the grid.

    Each tile can also have a size in the grid coordinates, making it more or less cells in the atlas.

    Alternatives version of a tile can be created using createAlternativeTile(atlasCoords:alternativeIdOverride:), which are then indexed using an alternative ID. The main tile (the one in the grid), is accessed with an alternative ID equal to 0.

    Each tile alternate has a set of properties that is defined by the source’s TileSet layers. Those properties are stored in a TileData object that can be accessed and modified using getTileData(atlasCoords:alternativeTile:).

    As TileData properties are stored directly in the TileSetAtlasSource resource, their properties might also be set using TileSetAtlasSource.set("<coords_x>:<coords_y>/<alternative_id>/<tile_data_property>").

    Superclasses

    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 example GString, 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.

    Types

    Type members

    Instance members