Class ccs.ComController

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for ccs.ComController

Method Summary

Class Detail

ccs.ComController()
Base class for ccs.ComController

Method Detail

  • <static> {ccs.ComController} ccs.ComController.create()
    allocates and initializes a ComController.
    // example
    var com = ccs.ComController.create();
    Returns:
    {ccs.ComController}
  • {Number} getTouchMode()
    returns the touch mode.
    Returns:
    {Number}
  • {Number} getTouchPriority()
    returns the priority of the touch event handler
    Returns:
    {Number}
  • {Boolean} isAccelerometerEnabled()
    whether or not it will receive Accelerometer events
    You can enable / disable accelerometer events with this property.
    Returns:
    {Boolean}
  • {Boolean} isEnabled()
    Enabled getter
    Returns:
    {Boolean}
  • {Boolean} isKeyboardEnabled()
    whether or not it will receive keyboard events
    You can enable / disable accelerometer events with this property.
    it's new in cocos2d-x
    Returns:
    {Boolean}
  • {Boolean} isMouseEnabled()
    MouseEnabled getter
    Returns:
    {Boolean}
  • {Boolean} isTouchEnabled()
    whether or not it will receive Touch events.
    You can enable / disable touch events with this property.
    Only the touches of this node will be affected. This "method" is not propagated to it's children.
    Returns:
    {Boolean}
  • onKeyDown(keyCode)
    Call back when a key is pressed down
    // example
    if(keyCode == cc.KEY.w){}
    Parameters:
    {Number} keyCode
  • onKeyUp(keyCode)
    Call back when a key is released
    // example
    if(keyCode == cc.KEY.w){}
    Parameters:
    {Number} keyCode
  • {Boolean} onMouseDown(event)

    called when the "mouseDown" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onMouseDragged(event)

    called when the "mouseDragged" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onMouseEntered(theEvent)

    called when the "mouseEntered" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    theEvent
    Returns:
    {Boolean}
  • {Boolean} onMouseExited(theEvent)

    called when the "mouseExited" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    theEvent
    Returns:
    {Boolean}
  • {Boolean} onMouseMoved(event)

    called when the "mouseMoved" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onMouseUp(event)

    called when the "mouseUp" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onOtherMouseDown(event)

    called when the "otherMouseDown" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onOtherMouseDragged(event)

    called when the "otherMouseDragged" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onOtherMouseUp(event)

    called when the "otherMouseUp" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onRightMouseDown(event)

    called when the "rightMouseDown" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onRightMouseDragged(event)

    called when the "rightMouseDragged" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onRightMouseUp(event)

    called when the "rightMouseUp" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onScrollWheel(event)

    called when the "scrollWheel" event is received.
    Return YES to avoid propagating the event to other delegates.

    Parameters:
    event
    Returns:
    {Boolean}
  • {Boolean} onTouchBegan(touch, event)
    default implements are used to call script callback if exist
    you must override these touch functions if you wish to utilize them
    Parameters:
    {cc.Touch} touch
    {event} event
    Returns:
    {Boolean}
  • onTouchCancelled(touch, event)
    Parameters:
    {cc.Touch} touch
    {event} event
  • onTouchEnded(touch, event)
    callback when a touch event finished
    Parameters:
    {cc.Touch} touch
    {event} event
  • onTouchesBegan(touch, event)
    Touches is the same as Touch, except this one can handle multi-touch
    Parameters:
    {cc.Touch} touch
    {event} event
  • onTouchesCancelled(touch, event)
    Parameters:
    touch
    event
  • onTouchesEnded(touch, event)
    when a touch finished
    Parameters:
    {cc.Touch} touch
    {event} event
  • onTouchesMoved(touch, event)
    when a touch moved
    Parameters:
    {cc.Touch} touch
    {event} event
  • onTouchMoved(touch, event)
    callback when a touch event moved
    Parameters:
    {cc.Touch} touch
    {event} event
  • registerWithTouchDispatcher()
    If isTouchEnabled, this method is called onEnter.
  • setAccelerometerEnabled(enabled)
    isAccelerometerEnabled setter
    Parameters:
    {Boolean} enabled
  • setAccelerometerInterval(interval)
    accelerometerInterval setter
    Parameters:
    {Number} interval
  • setEnabled(bool)
    Enabled setter
    Parameters:
    {Boolean} bool
  • setKeyboardEnabled(enabled)
    Enable Keyboard interaction
    Parameters:
    {Boolean} enabled
  • setMouseEnabled(enabled)
    MouseEnabled setter
    Parameters:
    {Boolean} enabled
  • setTouchEnabled(enabled)
    Enable touch events
    Parameters:
    {Boolean} enabled
  • setTouchMode(mode)
    Sets the touch mode.
    Parameters:
    {Number} mode
  • setTouchPriority(priority)
    Sets the touch event handler priority. Default is 0.
    Parameters:
    {Number} priority