TileGID

public struct TileGID : ExpressibleByIntegerLiteral, Equatable

Represents the reference to a specific Tile in a tile Layer for a given Map. It captures not only an identifier uniquely identifying the Tile (and the TileSet it is in) but also if the Tile should be flipped (see TileFlip)

  • Declaration

    Swift

    public typealias IntegerLiteralType = UInt32
  • The gobal tile offset which uniquely identifies the Tile for a given Map

    Declaration

    Swift

    public var globalTileOffset: UInt32 { get }
  • Create a new instance with the given raw value, note that unless you are creating a customized ResourceLoader you will not need this.

    Declaration

    Swift

    public init(integerLiteral value: UInt32)

    Parameters

    value

    The raw value (see TMX format description in the Tiled documentation)

  • Creates a new instance for the supplied Map globalTileOffset

    Declaration

    Swift

    public init(tileId: UInt32, flip: TileFlip)

    Parameters

    tileId

    The id of the tile in the set of TileSets for a Map

    flip

    Any transformations that should be applied

  • true if the tile should be flipped horizontally

    Declaration

    Swift

    public var flipHorizontally: Bool { get }
  • true if the tile should be flipped vertically

    Declaration

    Swift

    public var flipVertically: Bool { get }
  • true if the tile should be flipped diagonally

    Declaration

    Swift

    public var flipDiagonally: Bool { get }
  • The combined changes to the orientation of the tile

    Declaration

    Swift

    public var orientation: TileFlip { get }