Class
Scene
open class Scene : IdentifiableObject
A Scene
is responsible for providing the required Layer
s for an
application.
Relationships
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 | Type | Description |
---|---|---|
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
owningDirector
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().
moveZ(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().
preSetup(canvasSize:canvas:)
open func preSetup(canvasSize:Size, canvas:Canvas)
This function is invoked immediately prior to setting up layers.
postSetup(canvasSize:canvas:)
open func postSetup(canvasSize:Size, canvas:Canvas)
This function is invoked immediately after setting up layers.
preTeardown()
open func preTeardown()
This function is invoked immediately prior to tearing down layers.
postTeardown()
open func postTeardown()
This function is invoked immediately after tearing down layers.
preCalculate(canvas:)
open func preCalculate(canvas:Canvas)
This function is invoked immediately prior to calculating layers.
postCalculate(canvas:)
open func postCalculate(canvas:Canvas)
This function is invoked immediately after calculating layers.
preRender(canvas:)
open func preRender(canvas:Canvas)
This function is invoked immediately prior to rendering layers.
postRender(canvas:)
open func postRender(canvas:Canvas)
This function is invoked immediately after rendering layers.