Skip to content

3.7.1 Label

Jonas de Luna Skulberg edited this page Oct 21, 2023 · 4 revisions

Label

The label is mostly used to display the current position of a point or other compound components.

Extends:

Implements:

  • none

Parameters:

Required:

  • text?: string Text string to display.

Optional:

  • start: InputPosition Start position of the vector.
  • deltaX?: number Text offset x from start position.
  • deltaY?: number Text offset y from start position.

Default Parameters:

start: new Vector2(0, 0);
deltaX: 20;
deltaY: 4;

Implemented Methods:

  • none

Methods

  • none

Examples:

Offset 15, -15 makes the label line go downwards to the text.

const a = new Graphica();
const b = new Grid();
const c = new Label("testlabel", {
  start: [2, 5],
  deltaX: 15,
  deltaY: -5,
  fontSize: 30,
});

a.add(b);
a.add(c);
a.run();

image

Clone this wiki locally