Scenes Documentation Beta

Class Director

open class Director : IdentifiableObject, PainterProtocol, CustomStringConvertible 

A Director is responsible for managing an application and enqueuing Scenes.

%145 Director Director PainterProtocol PainterProtocol Director->PainterProtocol IdentifiableObject IdentifiableObject Director->IdentifiableObject CustomStringConvertible CustomStringConvertible Director->CustomStringConvertible

Superclass

IdentifiableObject

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

Conforms To

CustomStringConvertible
PainterProtocol

Initializers

init()

public required init() 

Properties

dispatcher

public lazy var dispatcher 

The event dispatcher for this director.

description

public var description : String 

Methods

setup(canvas:​)

public func setup(canvas:Canvas) 

calculate(canvas​Id:​canvas​Size:​)

public func calculate(canvasId:Int, canvasSize:Size?) 

render(canvas:​)

public func render(canvas:Canvas) 

on​Click(location:​)

public func onClick(location:Point) 

on​Mouse​Down(location:​)

public func onMouseDown(location:Point) 

on​Mouse​Up(location:​)

public func onMouseUp(location:Point) 

on​Window​Mouse​Up(location:​)

public func onWindowMouseUp(location:Point) 

on​Mouse​Move(location:​)

public func onMouseMove(location:Point) 

on​Key​Down(key:​code:​ctrl​Key:​shift​Key:​alt​Key:​meta​Key:​)

public func onKeyDown(key:String, code:String, ctrlKey:Bool, shiftKey:Bool, altKey:Bool, metaKey:Bool) 

on​Key​Up(key:​code:​ctrl​Key:​shift​Key:​alt​Key:​meta​Key:​)

public func onKeyUp(key:String, code:String, ctrlKey:Bool, shiftKey:Bool, altKey:Bool, metaKey:Bool) 

on​Canvas​Resize(size:​)

public func onCanvasResize(size:Size) 

on​Window​Resize(size:​)

public func onWindowResize(size:Size) 

enqueue​Scene(scene:​)

public func enqueueScene(scene:Scene) 

Enqueues the next scene to be used. To transition to next scene, use the transitionToNextScene method.

transition​ToNext​Scene()

public func transitionToNextScene() 

Tells the director to transition to the next enqueued scene. If no scene is enqueued, the application will enter an idle state.

frames​Per​Second()

open func framesPerSecond() -> Int 

This function is invoked to determine the framerate for this application.