Class
Director
open class Director : IdentifiableObject, PainterProtocol, CustomStringConvertible
A Director
is responsible for managing an application and enqueuing
Scene
s.
Relationships
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(canvasId:canvasSize:)
public func calculate(canvasId:Int, canvasSize:Size?)
render(canvas:)
public func render(canvas:Canvas)
onClick(location:)
public func onClick(location:Point)
onMouseDown(location:)
public func onMouseDown(location:Point)
onMouseUp(location:)
public func onMouseUp(location:Point)
onWindowMouseUp(location:)
public func onWindowMouseUp(location:Point)
onMouseMove(location:)
public func onMouseMove(location:Point)
onKeyDown(key:code:ctrlKey:shiftKey:altKey:metaKey:)
public func onKeyDown(key:String, code:String, ctrlKey:Bool, shiftKey:Bool, altKey:Bool, metaKey:Bool)
onKeyUp(key:code:ctrlKey:shiftKey:altKey:metaKey:)
public func onKeyUp(key:String, code:String, ctrlKey:Bool, shiftKey:Bool, altKey:Bool, metaKey:Bool)
onCanvasResize(size:)
public func onCanvasResize(size:Size)
onWindowResize(size:)
public func onWindowResize(size:Size)
enqueueScene(scene:)
public func enqueueScene(scene:Scene)
Enqueues the next scene to be used. To transition to next scene, use the transitionToNextScene method.
transitionToNextScene()
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.
framesPerSecond()
open func framesPerSecond() -> Int
This function is invoked to determine the framerate for this application.