Class CCViewController

The CCViewController class is the primary way to design behavior for a view or window. It owns a root view which is tied to the view controller, whose lifecycle is defined by the view controller.

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.

title?: string = undefined

A string which describes the view this controller holds.

view: CCView

The root view of the view controller.

Accessors

  • get isViewLoaded(): boolean
  • Whether the view has been loaded yet.

    Returns boolean

Methods

  • 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

  • Loads the view if it hasn't been loaded yet.

    Returns void

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

    Parameters

    • method: string

      The method that was attempted

    Returns void

  • 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

  • Called when the view has just appeared on screen.

    Parameters

    • animated: boolean

      Whether the view is being animated.

    Returns void

  • Called when the view has just disappeared from the screen.

    Parameters

    • animated: boolean

      Whether the view is being animated.

    Returns void

  • Called after the view has been loaded into memory.

    Returns void

  • Called when the view is being added to the view hierarchy.

    Parameters

    • animated: boolean

      Whether the view is being animated.

    Returns void

  • Called when the view is about to appear on screen.

    Parameters

    • animated: boolean

      Whether the view is being animated.

    Returns void

  • Called when the view is about to disappear from the screen.

    Parameters

    • animated: boolean

      Whether the view is being animated.

    Returns void