Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Cursor

Cursor.

Hierarchy

  • Cursor

Index

Properties

cursorMember

cursorMember: CursorMember

Information about the user operating the cursor.

divElement

divElement: HTMLDivElement

The container of the cursor, which is empty when the cursor is created. You can use the following code to add HTML elements into the container and change the cursor style.

example
const icon = document.createElement("img");
icon.src = "https://my-resources.com/icon.png";
cursor.divElement.append(icon);

height

height: number

The height of the cursor icon.

memberId

memberId: number

The ID of the user operating the cursor.

onCursorMemberChanged

onCursorMemberChanged: (cursorMember: CursorMember) => void

Type declaration

    • Occurs when cursorMember changes.

      You can use the following code to listen for this callback:

      example
      cursor.onCursorMemberChanged = function(cursorMember) {
      }

      Parameters

      Returns void

width

width: number

The width of the cursor icon.

x

x: number

The X coordinate of the center of the area the cursor is pointing to (taking the upper left corner of the initial whiteboard as the origin).

y

y: number

The Y coordinate of the center of the area the cursor is pointing to (taking the upper left corner of the initial whiteboard as the origin).

Methods

setCursorDescription

setReactNode

  • setReactNode(reactNode: any): void
  • Changes the cursor style using JSX.

    example
    cursor.setReactNode(
        <img src="https://my-resources.com/icon.png"/>
    );

    Parameters

    • reactNode: any

      The JSX that describes the cursor style.

    Returns void