Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UI

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new UI(group: Group, shape: UIShape, states: __type, id?: string): UI
  • Wrap an UI insider a group

    Parameters

    • group: Group
    • shape: UIShape
    • states: __type
    • Optional id: string

    Returns UI

Properties

Protected _actions

_actions: object

Type declaration

Protected _id

_id: string

Protected _states

_states: object

Type declaration

  • [key: string]: any

group

group: Group

shape

shape: UIShape

Accessors

id

  • get id(): string
  • set id(d: string): void
  • Get and set uique id

    Returns string

  • Get and set uique id

    Parameters

    • d: string

    Returns void

Methods

Protected _trigger

  • _trigger(p: Pt): boolean
  • Check intersection using a specific function based on UIShape

    Parameters

    • p: Pt

      a point to check

    Returns boolean

listen

  • listen(key: string, p: Pt): boolean
  • Listen for interactions and trigger action handlers

    Parameters

    • key: string

      action key

    • p: Pt

      point to check

    Returns boolean

off

  • off(key: string): this
  • Remove an event handler

    Parameters

    • key: string

      even key

    Returns this

on

  • Add an event handler

    Parameters

    • key: string

      event key

    • fn: UIHandler

      handler function

    Returns this

render

  • render(fn: function): void
  • Take a custom render function to render this UI

    Parameters

    • fn: function

      render function

        • (group: Group, states: object): void
        • Parameters

          • group: Group
          • states: object
            • [key: string]: any

          Returns void

    Returns void

state

  • state(key: string): any
  • Get a state

    Parameters

    • key: string

      state's name

    Returns any

Generated using TypeDoc