Class CCResponder

The CCResponder class handles receiving events from the application. Any object that wants to receive events must extend from CCResponder.

Hierarchy (View Summary)

Constructors

Properties

acceptsFirstResponder: boolean = true

Whether the object can become the first responder.

nextResponder?: CCResponder

The next responder in the responder chain.

Methods

  • Notifies the object that it's about to become the first responder.

    Returns boolean

    Whether to accept the first responder status

  • This is used to place a blinking cursor on screen while not drawing. It's only called on the first responder of a window.

    Returns undefined | [CCPoint, number]

    The position and color of the cursor in window coordinates, or undefined to not place a cursor

  • Sends a list of key input events to the input manager, which will send back text input events through insertText(text: string).

    Parameters

    • events: CCEvent[]

      The input events to send

    Returns void

  • Handles when a method action fails to find a responder.

    Parameters

    • method: string

      The method that was attempted

    Returns void

  • Notifies the object that it's about to no longer be the first responder.

    Returns boolean

    Whether to resign first responder status

  • Attempts to call the specified method on the object, passing the call on to the next responder if this object doesn't implement it.

    Parameters

    • method: string

      The name of the method to call

    • ...args: any[]

      Any parameters to pass to the method

    Returns boolean

    Whether a responder was able to respond to the method

  • Checks whether the passed object can become the first responder from the specified event.

    Parameters

    Returns boolean

    Whether the object is allowed to be the first responder