-
BObject
- EventDispatcher
Class: EventDispatcher
- Module
- cocos
- Defined In
- libs/cocos2d/EventDispatcher.js
- Extends
- BObject
Public Properties
| Property | Defined By | |
|---|---|---|
| Expand id |
id : Integer
<read-only>
Unique ID for this object
|
BObject |
| Expand sharedDispatcher |
sharedDispatcher : cocos.EventDispatcher
<static>
<read-only>
A shared singleton instance of cocos.EventDispatcher
|
EventDispatcher |
Public Methods
| Method | Defined By | |
|---|---|---|
| Expand EventDispatcher |
new
EventDispatcher ()
:
cocos.EventDispatcher
<constructor>
This singleton is responsible for dispatching Mouse and Keyboard events.
Returns
|
EventDispatcher |
| Expand addDelegate |
addDelegate (opts:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand addKeyboardDelegate |
addKeyboardDelegate (opts:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand addMouseDelegate |
addMouseDelegate (opts:*)
:
void
Arguments
Returns
|
EventDispatcher |
| 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
Returns
|
BObject |
| Expand changed |
changed (key:*)
:
void
Arguments
Returns
|
BObject |
| 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
Returns
|
BObject |
| Expand keyDown |
keyDown (evt:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand keyUp |
keyUp (evt:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand mouseDown |
mouseDown (evt:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand mouseDragged |
mouseDragged (evt:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand mouseMoved |
mouseMoved (evt:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand mouseUp |
mouseUp (evt:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand removeAllDelegates |
removeAllDelegates (opts:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand removeAllKeyboardDelegate |
removeAllKeyboardDelegate ()
:
void
Returns
|
EventDispatcher |
| Expand removeAllMouseDelegate |
removeAllMouseDelegate ()
:
void
Returns
|
EventDispatcher |
| Expand removeDelegate |
removeDelegate (opts:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand removeKeyboardDelegate |
removeKeyboardDelegate (opts:*)
:
void
Arguments
Returns
|
EventDispatcher |
| Expand removeMouseDelegate |
removeMouseDelegate (opts:*)
:
void
Arguments
Returns
|
EventDispatcher |
| 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
Returns
|
BObject |
| Expand setValues |
setValues (kvp:Object)
:
void
Set multiple propertys in one go
Arguments
Returns
|
BObject |
| Expand unbind |
unbind (key:String)
:
void
Remove binding from a property which set setup using BObject#bindTo.
Arguments
Returns
|
BObject |
| Expand unbindAll |
unbindAll ()
:
void
Remove all bindings on this object
Returns
|
BObject |
Private Members
This class has no private members.