SKImageLayer
public class SKImageLayer : SKTiledLayerObject
Overview
The SKImageLayer
object is really nothing more than a sprite with positioning attributes.
Properties
Property | Description |
---|---|
image | Layer image name. |
wrapX | Wrap horizontally. |
wrapY | Wrap vertically. |
Methods
Method | Description |
---|---|
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")
-
Set the layer image as a sprite.
Declaration
Swift
public func setLayerImage(_ named: String)
Parameters
named
String
image name. -
Update the layer texture.
Declaration
Swift
public func setLayerTexture(texture: SKTexture)
Parameters
texture
SKTexture
layer image texture.
-
Update the image layer before each frame is rendered.
Declaration
Swift
override public func update(_ currentTime: TimeInterval)
Parameters
currentTime
TimeInterval
update interval. -
Parse the image layer’s properties.
Declaration
Swift
override public func parseProperties(completion: (() -> Void)?)