SKImageLayer
public class SKImageLayer : TiledLayerObject
The SKImageLayer
object is really nothing more than a sprite with positioning attributes.
Properties
image
: Layer image name.wrapX
: Wrap horizontally.wrapY
: Wrap vertically.
Methods
setLayerImage
: set the layer’s image.setLayerTexture
: set the layer’s texture.wrapY
: wrap vertically.
Usage
Set the layer image with:
imageLayer.setLayerImage("clouds-background")
-
Layer image name.
Declaration
Swift
public var image: String!
-
Layer wraps horizontally.
Declaration
Swift
public var wrapX: Bool
-
Layer wraps vertically.
Declaration
Swift
public var wrapY: Bool
-
Set the layer image as a sprite.
Declaration
Swift
public func setLayerImage(_ named: String)
Parameters
named
image name.
-
Update the layer texture.
Declaration
Swift
public func setLayerTexture(texture: SKTexture)
Parameters
texture
layer image texture.
-
Instantiate the node with a decoder instance.
Declaration
Swift
required public init?(coder aDecoder: NSCoder)
Parameters
aDecoder
decoder.
-
Update the image layer before each frame is rendered.
Declaration
Swift
public override func update(_ currentTime: TimeInterval)
Parameters
currentTime
update interval.
-
Returns the internal Tiled node type.
Declaration
Swift
@objc public var tiledElementName: String { get }
-
Returns a “nicer” node name, for usage in the inspector.
Declaration
Swift
@objc public override var tiledNodeNiceName: String { get }
-
Returns the internal Tiled node type icon.
Declaration
Swift
@objc public override var tiledIconName: String { get }
-
A description of the node type used for help features.
Declaration
Swift
@objc public override var tiledHelpDescription: String { get }
-
Parse the image layer’s properties.
Declaration
Swift
public override func parseProperties(completion: (() -> Void)?)
Parameters
completion
optional completion closure.