ObjectFactory
public protocol ObjectFactory : Producer
Tile factories create the sprites that will be rendered for tiles
-
Creates a point object
Declaration
Swift
func make(pointFor object: ObjectProtocol, in map: Map, from project: Project) throws -> EngineType.PointObjectType?Parameters
objectThe meta-data for the object
mapThe map the object is in
projectThe project the map was loaded from
-
Creates a rectangle object of the specified size
Declaration
Swift
func make(rectangleOf size: Size, at angle: Double, for object: ObjectProtocol, in map: Map, from project: Project) throws -> EngineType.RectangleObjectType?Parameters
sizeThe
Sizeof the rectangleangleThe angle the rectangle should be displayed in (in degrees)
objectThe meta-data about the object
mapThe map the object is in
projectThe project content is being loaded from
-
Creates a ellipse object of the specified size
Declaration
Swift
func make(ellipseOf size: Size, at angle: Double, for object: ObjectProtocol, in map: Map, from project: Project) throws -> EngineType.EllipseObjectType?Parameters
sizeThe
Sizeof the ellipseangleThe angle the ellipse should be displayed in (in degrees)
objectThe meta-data about the object
mapThe map the object is in
projectThe project content is being loaded from
-
Creates a sprite for the specified tile
Declaration
Parameters
tileIdThe Gid of the tile
sizeThe size of the sprite
angleThe angle the sprite should be displayed at
tilesThe tiles loaded by the map (indexable by GID)
objectThe meta-data about the object
mapThe map the object is in
projectThe project the map was loaded from
-
Creates a text object
Declaration
Swift
func make(textWith string: String, of size: Size, at angle: Double, with style: TextStyle, for object: ObjectProtocol, in map: Map, from project: Project) throws -> EngineType.TextObjectType?Parameters
stringThe string to display
sizeThe size of the clipping rectangle of the text
angleThe angle the text should be displayed at
styleThe style the text should be rendered in
objectThe meta-data about the object
mapThe map the object is in
projectThe project the map was loaded from
-
Creates a polyline (non-closed path) object
Declaration
Swift
func make(polylineWith path: Path, at angle: Double, for object: ObjectProtocol, in map: Map, from project: Project) throws -> EngineType.PolylineObjectType?Parameters
pathThe points of the path
angleThe angle the object should be shown at
objectMeta-data about the object
mapThe map the object is in
projectThe project the map was loaded from
-
Creates a polygon (closed path) object
Declaration
Swift
func make(polygonWith path: Path, at angle: Double, for object: ObjectProtocol, in map: Map, from project: Project) throws -> EngineType.PolygonObjectType?Parameters
pathThe points of the path
angleThe angle the object should be shown at
objectMeta-data about the object
mapThe map the object is in
projectThe project the map was loaded from
View on GitHub
ObjectFactory Protocol Reference