Class representing a pointer object.

Remarks

You can have several pointer objects concurrently. Each pointer object represents a literal "pointer".

Example

const pointer1 = new Pointer({
pointerShape: ['string', '👆'],
size: 50,
drag: 0.1,
xCharOffset: 18,
yCharOffset: 85,
rotation: -40,
xOffset: 0,
yOffset: 0
})

Hierarchy

  • Pointer

Implements

Constructors

Properties

Constructors

  • Creates a pointer object

    Returns

    a Pointer object

    Parameters

    • pointerOptions: Partial<pointerOptionsInterface>

      These are options that control the behavior of a pointer object and the defaults are:

      {
      pointerShape: ['string','💧'],
      colors: ['default'],
      drag: 0,
      size: 50,
      rotation: 0,
      xCharOffset: 0,
      yCharOffset: 0,
      xOffset: 0,
      yOffset: 0
      }

    Returns Pointer

Properties

pointerOptions: pointerOptionsInterface
startPointer: ((canvas?: HTMLCanvasElement) => void)

Type declaration

    • (canvas?: HTMLCanvasElement): void
    • Internal function used by the pointer to initialize itself on the canvas

      Remarks

      This function calls the init function from the canvas drawing, a user should rarely have to call this function or the init function manually

      Parameters

      • Optional canvas: HTMLCanvasElement

      Returns void

Generated using TypeDoc