TiledMappableGeometryType
@objc
public protocol TiledMappableGeometryType : TiledGeometryType
The TiledMappableGeometryType protocol describes a container that is broken up into two-dimensional tiles.
Properties
orientation: Container orientationisInfinite: Container represents and infinite area.mapSize: Container size (in tiles)graph: Container pathfinding graph (optional)childOffset: Child node offset (optional)tileSize: Tile size (in pixels)hexsidelength: Hexagonal side lengthstaggeraxis: Hexagonal stagger axisstaggerindex: Hexagonal stagger index
-
The map projection type.
Declaration
Swift
@objc var orientation: TilemapOrientation { get } -
Indicates the container represents an infinite map.
Declaration
Swift
@objc var isInfinite: Bool { get } -
Container size (in tiles).
Declaration
Swift
@objc var mapSize: CGSize { get } -
Optional pathfinding
GKGridGraphgraph.Declaration
Swift
@objc optional weak var graph: GKGridGraph<GKGridGraphNode>? { get set } -
Child node offset. Used by a map container to align child layers.
Declaration
Swift
@objc optional var childOffset: CGPoint { get } -
Tile size (in pixels).
Declaration
Swift
@objc var tileSize: CGSize { get } -
Hexagonal side length.
Declaration
Swift
@objc var hexsidelength: Int { get set } -
Hexagonal stagger axis.
Declaration
Swift
@objc var staggeraxis: StaggerAxis { get set } -
Hexagonal stagger index.
Declaration
Swift
@objc var staggerindex: StaggerIndex { get set }
-
widthExtension methodReturns the width (in tiles) of the container.
Declaration
Swift
public var width: CGFloat { get } -
heightExtension methodReturns the height (in tiles) of the container.
Declaration
Swift
public var height: CGFloat { get } -
sizeHalvedExtension methodReturns the size (in tiles) of the container halved.
Declaration
Swift
public var sizeHalved: CGSize { get } -
tileWidthExtension methodReturns the tile width (in pixels) value.
Declaration
Swift
public var tileWidth: CGFloat { get } -
tileHeightExtension methodReturns the tile height (in pixels) value.
Declaration
Swift
public var tileHeight: CGFloat { get } -
tileSizeHalvedExtension methodReturns the tile size (in pixels) of the container halved.
Declaration
Swift
public var tileSizeHalved: CGSize { get } -
tileWidthHalfExtension methodReturns the tile size width (in pixels), halved.
Declaration
Swift
public var tileWidthHalf: CGFloat { get }Return Value
tile size half-width.
-
tileHeightHalfExtension methodReturns the tile size height (in pixels), halved.
Declaration
Swift
public var tileHeightHalf: CGFloat { get }Return Value
tile size half-height.
-
sizeInPointsExtension methodReturns the size of the container, in points.
Declaration
Swift
public var sizeInPoints: CGSize { get } -
sizeInPixelsExtension methodThe size of the container, in pixels.
Declaration
Swift
public var sizeInPixels: CGSize { get }
-
originExtension methodReturns the position of layer origin point. Used only in
SKTileObject.getVertices(offset:).Declaration
Swift
public var origin: CGPoint { get }
-
staggerXExtension methodIndicates the x-axis should be staggered.
Declaration
Swift
public var staggerX: Bool { get } -
staggerEvenExtension methodIndicates even rows should be staggered.
Declaration
Swift
public var staggerEven: Bool { get } -
sideLengthXExtension methodReturns the side length for flat hexagons.
Declaration
Swift
public var sideLengthX: CGFloat { get } -
sideLengthYExtension methodReturns the side length for pointy hexagons.
Declaration
Swift
public var sideLengthY: CGFloat { get } -
sideOffsetXExtension methodReturns the side offset in x.
Declaration
Swift
public var sideOffsetX: CGFloat { get }
-
pointForCoordinate(coord:Extension methodoffsetX: offsetY: ) Returns a screen point for a given coordinate in the object (layer or map), with optional offset values for x/y.
Declaration
Swift
public func pointForCoordinate(coord: simd_int2, offsetX: CGFloat = 0, offsetY: CGFloat = 0) -> CGPointParameters
coordtile coordinate.
offsetXx-offset value.
offsetYy-offset value.
Return Value
point in layer (spritekit space).
-
coordinateForPoint(point:Extension method) Returns a tile coordinate for a given screen point in the object (layer or map).
Declaration
Swift
public func coordinateForPoint(point: CGPoint) -> simd_int2Parameters
pointpoint in layer (spritekit space).
Return Value
tile coordinate.
-
shaderUniformsExtension methodReturns an array of shader unforms based on the current attributes.
Declaration
Swift
public var shaderUniforms: [SKUniform] { get }
-
parentsExtension methodReturns an array of parent layers, beginning with the current.
Declaration
Swift
public var parents: [SKNode] { get } -
addChild(_:Extension methodcoord: offset: zpos: ) Add an
SKNodechild node at the given coordinates. By default, the zPositon will be higher than all of the other nodes in the layer.Declaration
Swift
public func addChild(_ node: SKNode, coord: simd_int2, offset: CGPoint = CGPoint.zero, zpos: CGFloat? = nil)Parameters
nodeSpriteKit node.
coordmap coordinate.
offsetoffset amount.
zposoptional z-position.
-
addChild(_:Extension methodx: y: offset: zpos: ) Add an
SKNodechild node at the given x/y coordinates. By default, the zPositon will be higher than all of the other nodes in the layer.Declaration
Swift
public func addChild(_ node: SKNode, x: Int = 0, y: Int = 0, offset: CGPoint = CGPoint.zero, zpos: CGFloat? = nil)Parameters
nodeobject.
xmap x-coordinate.
ymap y-coordinate.
offsetoffset amount.
zposoptional z-position.
-
addChild(_:Extension method_: _: dx: dy: zpos: ) Add a node at the given coordinates. By default, the zPositon will be higher than all of the other nodes in the layer.
Declaration
Swift
public func addChild(_ node: SKNode, _ x: Int, _ y: Int, dx: CGFloat = 0, dy: CGFloat = 0, zpos: CGFloat? = nil)Parameters
nodeSpriteKit node.
xmap x-coordinate.
ymap y-coordinate.
dxoffset x-amount.
dyoffset y-amount.
zposz-position (optional).
View on GitHub
Install in Dash
TiledMappableGeometryType Protocol Reference