-
Notifications
You must be signed in to change notification settings - Fork 0
3.2 Point
amaliejvik edited this page Aug 5, 2024
·
7 revisions
Note that point may also be passed as a position to some components as it is considered an InputPosition
-
x: numberX position of the point -
y: numberY position of the point
-
label?: booleanWhether or not to display the point's current position beside it. -
decimals?: numberNumber of decimals to include in the label. -
color?: stringColor of the main part of the point. -
draggable?: DraggableWhether the point should be draggable. -
dragListeners?: ((point: Point) => void)[]Initial dragListeners that can be added upon construction of the point. -
customName?: stringGive point a custom name, if none given, defaults to A,B,C... -
showName?: stringWhether or not to display the point's name beside it -
legendCoordinates?: stringWhich coordinates of the point that will be displayed in the LegendBox ("x" for only x-coordinates, "y" for only y-coordinates). Defaults to both x and y being shown.
color: "#FAA307",
draggable: undefined,
decimals: 1,
label: false,
dragListeners: [],
showName: true,
legendCoordinates: "", (both x and y coordinates displayed)
-
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): booleandistanceTo(other: Object3D<Event>): numbergetName(): stringgetDisplayText(): stringhover(): voidunhover(): void
-
setPosition(x: number, y: number): Sets position of the point to specified coordinates.