Map
public struct Map : LayerContainer, Loadable, MutablePropertied
Represents a Tiled map which can be loaded from a Tiled tmx file (other Tiled formats can be supported in the future, such as JSON). It contains the root collection of Layers as well as carrying the references to the TileSets used by the Map
-
The size of the map in tiles
Declaration
Swift
public let mapSize: TileGridSize -
The size of a tile in pixels
Declaration
Swift
public let tileSize: PixelSize -
Properties of the map
Declaration
Swift
public var properties: Properties -
The size of the map in pixels
Declaration
Swift
public var pixelSize: PixelSize { get } -
The orientation of the map
Declaration
Swift
public var orientation: Orientation -
The rendering order the map was designed in
Declaration
Swift
public var renderingOrder: RenderingOrder -
The color that should be used to render the background of the map
Declaration
Swift
public var backgroundColor: Color? -
The various layers in the map
Declaration
Swift
public var layers: [Layer] -
The tilesets the map uses
Declaration
Swift
public var tileSets: [TileSet] { get } -
Creates a new instance of a map
Declaration
Swift
public init(with mapSize: TileGridSize, and tileSize: PixelSize, orientation: Orientation, renderingOrder: RenderingOrder)Parameters
mapSizeThe size of the map in tiles
tileSizeThe size of tiles in the map (pixel dimensions)
orientationThe
Orientationof the maprenderingOrderThe
RenderingOrderof the map -
Creates and returns an instance of
MapLoaderwhich will load maps from Tiled tmx filesDeclaration
Swift
public static func loader(for project: Project) -> ResourceLoaderParameters
projectThe project the
Mapwill be loaded intoReturn Value
An instance of
MapLoader -
Maps should be cached, as they are value types a new instance is created anyway so there will not be unintended side effects
Declaration
Swift
public let cache: Bool -
Returns
selfas it is a value typeDeclaration
Swift
public func newInstance() -> MapReturn Value
This value
View on GitHub
Map Structure Reference