Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Node Abstract

A Node in the scene-graph, consisting of a Transform

Hierarchy

Implements

Index

Constructors

  • A scene-graph Node

    Parameters

    • id: string

      A unique identifier for this node

    • position: Vector

      Position where the node will be first initiated

    • controlPoints: Vector[]

      A set of Vectors defining points of control for this Node, for e.g. for a Rectangle, the four corners are its control points, transformations such as position, rotation and scale are applied to these control points

    Returns Node

Properties

context: CanvasRenderingContext2D
drawing: Drawing
hitColor: Color
id: string
offContext: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D
order: number
registeredEvents: any
transform: Transform

Accessors

  • get absolutePosition(): Vector
  • get childs(): Node[]
  • get localRotation(): number
  • set localRotation(degrees: number): void
  • get parent(): Node
  • set parent(newParent: Node): void
  • get rotation(): number
  • set rotation(degrees: number): void
  • get zIndex(): number
  • set zIndex(zIndex: number): void

Methods

  • _offRender(): void
  • _render(): void
  • call(method: string, args?: any[]): void
  • Calls all the event callbacks registered using on

    Parameters

    • method: string
    • Optional args: any[]

    Returns void

  • dispose(): void
  • offRender(): void
  • Calls internal _offRender function for this node

    Returns void

  • on(eventKey: string, callback: Function): void
  • Register an event on this Node

    Parameters

    • eventKey: string

      name of the event

    • callback: Function

      callback

    Returns void

  • render(): void
  • Calls internal _render/_offRender functions and recursively invokes render functions for all child nodes

    Returns void

  • setHitColor(): void
  • Sets a unique color for this node on hit-maps

    Returns void