Skip to content

3.2 Point

Jonas de Luna Skulberg edited this page Oct 6, 2023 · 7 revisions

Point

Note that point may also be passed as a position to some components. This

Extends:

Implements:

Parameters:

Required:

  • x: number X position of the point
  • y: number Y position of the point

Optional:

label?: boolean Whether or not to display the point's current position beside it. decimals?: number Number of decimals to include in the label. color?: string Color of the main part of the point. draggable?: Draggable Whether the point should be draggable. dragListeners?: ((point: Point) => void)[] Initial dragListeners that can be added upon construction of the point.

Default Parameters:

  color: "#FAA307",
  draggable: undefined,
  decimals: 1,
  label: false,
  dragListeners: [],

Implemented Methods:

  • addDragListener(listener: (point: Point) => void) Adds a draglistener to the point. The parameter of the listenerfunction takes in a reference to the instance of the point the listener is attached to.
  • collidesWith(other: Object3D): boolean
  • distanceTo(other: Object3D<Event>): number

Methods

Clone this wiki locally