Class CCMenuItem

Stores information about a single menu item.

Constructors

  • Creates a new menu item for a separator.

    Returns CCMenuItem

  • Creates a new menu item for an action.

    Parameters

    • title: string

      The title for the action

    • action: () => void

      The function to call when the action is triggered

    • OptionalkeyCombo: CCKeyCombo

      A key combo that will trigger the action, if desired

    Returns CCMenuItem

  • Creates a new menu item for a submenu.

    Parameters

    • title: string

      The title for the submenu

    • menu: CCMenu

      The menu to display under this item

    Returns CCMenuItem

Accessors

  • get action(): undefined | () => void
  • The function to call when this action is triggered.

    Returns undefined | () => void

  • set action(value: undefined | () => void): void
  • Parameters

    • value: undefined | () => void

    Returns void

  • get isEnabled(): boolean
  • Whether the item is enabled.

    Returns boolean

  • set isEnabled(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get keyCombo(): undefined | CCKeyCombo
  • A key combo that will trigger the action.

    Returns undefined | CCKeyCombo

  • set keyCombo(value: undefined | CCKeyCombo): void
  • Parameters

    Returns void

  • A submenu to display under this item.

    Returns undefined | CCMenu

  • Parameters

    Returns void

  • get supermenu(): undefined | CCMenu
  • The menu that owns this item.

    Returns undefined | CCMenu

  • set supermenu(value: undefined | CCMenu): void
  • Parameters

    Returns void

  • get title(): undefined | string
  • The title of the menu item.

    Returns undefined | string

  • set title(value: undefined | string): void
  • Parameters

    • value: undefined | string

    Returns void

Methods

  • Triggers an incoming action on this item or a nested subitem.

    Parameters

    • key: string

      The key of the item that was triggered

    Returns boolean

    Whether an item triggered an action