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")

Init

Updating: Image Layer

  • ▶︎update(_:)

    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)?)