Selection API. Allows selecting Entities, Assets etc.

Hierarchy

  • Events
    • Selection

Internal

Other

  • Add item to selection

    Parameters

    • item: any
    • options: { history?: boolean } = {}

    Returns void

    // add root entity to selection
    editor.selection.add(editor.entities.root);
  • Checks if item is in selection

    Parameters

    • item: any

    Returns boolean

    const isRootSelected = editor.selection.has(editor.entities.root);
    
  • Remove item from selection

    Parameters

    • item: any
    • options: { history?: boolean } = {}

    Returns void

    // remove root entity from selection
    editor.selection.remove(editor.entities.root);
  • Sets current selection

    Parameters

    • items: any[]
    • options: { history?: boolean } = {}

    Returns void

    // select root entity
    editor.selection.set([editor.entities.root]);
  • Toggle item selection

    Parameters

    • item: any
    • options: { history?: boolean } = {}

    Returns void

    // toggle root entity selection
    editor.selection.toggle(editor.entities.root);