LayerFactory

public protocol LayerFactory : Producer

Undocumented

  • Creates a sprite for the supplied image layer

    Declaration

    Swift

    func make(spriteFor imageReference: ImageReference, for layer: LayerProtocol, in map: Map, from project: Project) throws -> EngineType.SpriteType?

    Parameters

    imageReference

    The file reference to the image

    layer

    The additional data from the layer

    map

    The map the layer is part of

    project

    The project the map is being loaded from

  • Creates a layer to contain objects

    Declaration

    Swift

    func make(objectContainerFor layer: LayerProtocol, in map: Map, from project: Project) throws -> EngineType.ObjectLayerType?

    Parameters

    layer

    The additional data from the layer

    map

    The map the layer is part of

    project

    The project the map is being loaded from

  • Creates a layer containing other layers

    Declaration

    Swift

    func make(groupFor layer: LayerProtocol, in map: Map, from project: Project) throws -> EngineType.GroupLayerType?

    Parameters

    layer

    The details of the grouping layer

    map

    The Map the layer belongs to

    project

    The project the map is being loaded from

  • Creates a tile layer with the supplied tiles in using the sprites loaded during map building

    Declaration

    Swift

    func make(tileLayerFor layer: LayerProtocol, with sprites: MapTiles<EngineType>, in map: Map, from project: Project) throws -> EngineType.TileLayerType?

    Parameters

    layer

    The meta data about the layer

    sprites

    The sprites (indexed by gid) that can be used

    map

    The map the layer is in

    project

    The project the layer is loaded from

  • Called for each tile in a tile layer. The position in the layer is supplied in Tiled coordinates

    Declaration

    Swift

    func make(tileWith tileGid: TileGID, definedBy tile: Tile, and tilset: TileSet, at position: Position, with sprites: MapTiles<EngineType>, for tileLayer: LayerProtocol, in map: Map, from project: Project) throws -> EngineType.SpriteType?

    Parameters

    tile

    A new instance of the tile representation in your specific game engine

    position

    The location, in tiled coordinates, to position the tile at

    tileLayer

    The tile layer containing the tile

    map

    The map containing the tile layer

    project

    The project containing the map