TileGrid

public struct TileGrid

Represents a two dimensional grid of tiles (such as that in a tile Layer

  • The size of the grid (in tiles)

    Declaration

    Swift

    public let size: TileGridSize
  • Retreives a TileGID for the Tile at the specied location

    Declaration

    Swift

    public subscript(x: Int, y: Int) -> TileGID { get }

    Parameters

    x

    The x position

    y

    The y position

    Return Value

    The TileGID of the specified tile

  • Creates a new TileGrid using the supplied array of TileGIDs

    Declaration

    Swift

    public init(_ grid: [TileGID], size: TileGridSize)

    Parameters

    grid

    The TileGIDs to use. There should be size.width * size.height elements

    size

    The Dimensions of the grid