Skip to content

3.3 Line

AdrianSolberg edited this page Jul 3, 2024 · 6 revisions

Line

Extends:

Implements:

Parameters:

Required:

  • start: InputPosition Start position of the line
  • end: InputPosition End position of the line

Optional:

  • color: number Color of the line in hex.
  • lineWidth?: number
  • arrowhead?: boolean Whether the line should have an arrowhead.
  • dashed?: boolean Whether the line should be dashed.
  • opacity?: number Opacity of the line.
  • transparent?: boolean Whether the line should be transparent.
  • draggable?: Draggable Whether the line should be draggable.
  • curve?: number Amount of curvature of the line.
  • label?: string Label for the line.

Default Parameters:

  color: 0x080007,
  lineWidth: 4,
  arrowhead: false,
  dashed: false,
  opacity: 1,
  transparent: false,
  curve: 0,
  label: "",

Implemented Methods:

  • collidesWith(other: Object3D): boolean
  • distanceTo(other: Object3D<Event>): number

Methods

  • setPosition(start: InputPosition, end: InputPosition) Sets the Line position to specified values.
  • setStart(start: InputPosition) Sets the start position of the Line to specified value.
  • setEnd(end: InputPosition) Sets the end position of the Line to specified value.
  • setZIndex(z: number) Sets the z-index of the Line.
  • setCurve(curve: number) Sets the amount of curve for the Line.
  • public setLabel(label: string) Sets the label for the Line.

Clone this wiki locally