Cocos2D JavaScript (v0.2.0-beta) API Documentation

Class: DirectorFixedSpeed

Module
cocos
Defined In
Director.js
Extends
Director
Pretends to run at a constant frame rate even if it slows down

Public Properties

Property Defined By
Expand frameRate frameRate : Integer <static>
Frames per second to draw.
DirectorFixedSpeed
Expand id id : Integer <read-only>
Unique ID for this object
BObject

Public Methods

Method Defined By
Expand DirectorFixedSpeed new DirectorFixedSpeed () : cocos.DirectorFixedSpeed <constructor>

Returns

DirectorFixedSpeed
Expand animate animate () : void

Returns

  • void
Director
Expand attachInView attachInView (view:HTMLElement) : void
Append to a HTML element. It will create a canvas tag

Arguments

  1. view : HTMLElement
    Any HTML element to add the application to

Returns

  • void
Director
Expand bindTo bindTo (key:String,target:BOject,[targetKey:String],[noNotify:Boolean]) : void
Bind the value of a property on this object to that of another object so they always have the same value. Setting the value on either object will update the other too.

Arguments

  1. key : String
    Name of the property on this object that should be bound
  2. target : BOject
    Object to bind to
  3. targetKey : String (Optional)
    Key on the target object to bind to
  4. noNotify : Boolean (Optional)
    Set to true to prevent this object's property triggering a 'changed' event when adding the binding

Returns

  • void
BObject
Expand changed changed (key:*) : void

Arguments

  1. key :

Returns

  • void
BObject
Expand convertEventToCanvas convertEventToCanvas (evt:*) : void

Arguments

  1. evt :

Returns

  • void
Director
Expand get get (key:String) : *
Get a property from the object. Always use this instead of trying to access the property directly. This will ensure all bindings, setters and getters work correctly.

Arguments

  1. key : String
    Name of property to get or dot (.) separated path to a property

Returns

  • *
    Value of the property
BObject
Expand popScene popScene () : void
Pops out a scene from the queue. This scene will replace the running one. The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. ONLY call it if there is a running scene.

Returns

  • void
Director
Expand pushScene pushScene (scene:cocos.Scene) : void
Suspends the execution of the running scene, pushing it on the stack of suspended scenes. The new scene will be executed. Try to avoid big stacks of pushed scenes to reduce memory allocation. ONLY call it if there is a running scene.

Arguments

  1. scene : cocos.Scene
    The scene to add to the stack

Returns

  • void
Director
Expand replaceScene replaceScene (scene:cocos.Scene) : void
Replaces the running scene with a new one. The running scene is terminated. ONLY call it if there is a running scene.

Arguments

  1. scene : cocos.Scene
    The scene to replace with

Returns

  • void
Director
Expand runPreloadScene runPreloadScene () : void

Returns

  • void
Director
Expand runWithScene runWithScene (scene:cocos.Scene) : void
Enters the Director's main loop with the given Scene. Call it to run only your FIRST scene. Don't call it if there is already a running scene.

Arguments

  1. scene : cocos.Scene
    The scene to start

Returns

  • void
Director
Expand set set (key:String,value:*) : void
Set a property on the object. Always use this instead of trying to access the property directly. This will ensure all bindings, setters and getters work correctly.

Arguments

  1. key : String
    Name of property to get
  2. value : *
    New value for the property

Returns

  • void
BObject
Expand setValues setValues (kvp:Object) : void
Set multiple propertys in one go

Arguments

  1. kvp : Object
    An Object where the key is a property name and the value is the value to assign to the property

Returns

  • void
BObject
Expand showFPS showFPS () : void

Returns

  • void
Director
Expand startAnimation startAnimation () : void <static>
The main loop is triggered again. Call this function only if cocos.Directory#stopAnimation was called earlier.

Returns

  • void
DirectorFixedSpeed
Expand stopAnimation stopAnimation () : void
Stops the animation. Nothing will be drawn. The main loop won't be triggered anymore. If you want to pause your animation call cocos.Directory#pause instead.

Returns

  • void
Director
Expand unbind unbind (key:String) : void
Remove binding from a property which set setup using BObject#bindTo.

Arguments

  1. key : String
    Name of the property on this object to unbind

Returns

  • void
BObject
Expand unbindAll unbindAll () : void
Remove all bindings on this object

Returns

  • void
BObject

Private Members

This class has no private members.