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
imageReferenceThe file reference to the image
layerThe additional data from the layer
mapThe map the layer is part of
projectThe 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
layerThe additional data from the layer
mapThe map the layer is part of
projectThe 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
layerThe details of the grouping layer
mapThe
Mapthe layer belongs toprojectThe 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
layerThe meta data about the layer
spritesThe sprites (indexed by gid) that can be used
mapThe map the layer is in
projectThe 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
Parameters
tileA new instance of the tile representation in your specific game engine
positionThe location, in tiled coordinates, to position the tile at
tileLayerThe tile layer containing the tile
mapThe map containing the tile layer
projectThe project containing the map
View on GitHub
LayerFactory Protocol Reference