Scenes Documentation Beta

Class Scene

open class Scene : IdentifiableObject 

A Scene is responsible for providing the required Layers for an application.

%25 Scene Scene IdentifiableObject IdentifiableObject Scene->IdentifiableObject

Superclass

IdentifiableObject

IdentifiableObject provides base functionality for using unique names that are useful for debugging.

Initializers

init(name:​)

public override init(name:String?=nil) 

Creates a new Scene from the given parameters:

Parameters

name String?

The unique name of this scene. While it's very useful for debugging purposes to provide a meaningful name, it's not required.

Properties

owning​Director

public private(set) weak var owningDirector : Director?

director

public var director : Director 

The owning director for this scene.

dispatcher

public var dispatcher : Dispatcher 

The event dispatcher for this scenes owning director.

Methods

insert(layer:​at:​)

public func insert(layer:Layer, at zLocation:ZOrder<Layer>) 

Inserts the specified layer at the specified location. This function should only be invoked during init(), setup(), or calculate().

remove(layer:​)

public func remove(layer: Layer) 

Removes the specified layer from this scene. This function should only be invoked during init(), setup(), or calculate().

move​Z(of:​to:​)

public func moveZ(of layer:Layer, to zLocation:ZOrder<Layer>) 

Moves the z-index value of the specified layer according to the specified location. This function should only be invoked during init(), setup(), or calculate().

pre​Setup(canvas​Size:​canvas:​)

open func preSetup(canvasSize:Size, canvas:Canvas) 

This function is invoked immediately prior to setting up layers.

post​Setup(canvas​Size:​canvas:​)

open func postSetup(canvasSize:Size, canvas:Canvas) 

This function is invoked immediately after setting up layers.

pre​Teardown()

open func preTeardown() 

This function is invoked immediately prior to tearing down layers.

post​Teardown()

open func postTeardown() 

This function is invoked immediately after tearing down layers.

pre​Calculate(canvas:​)

open func preCalculate(canvas:Canvas) 

This function is invoked immediately prior to calculating layers.

post​Calculate(canvas:​)

open func postCalculate(canvas:Canvas) 

This function is invoked immediately after calculating layers.

pre​Render(canvas:​)

open func preRender(canvas:Canvas) 

This function is invoked immediately prior to rendering layers.

post​Render(canvas:​)

open func postRender(canvas:Canvas) 

This function is invoked immediately after rendering layers.