EarthSDK
    正在准备搜索索引...

    类 CursorInfo<DivClass>

    用来创建跟随光标运动的div,可以任意填充内容

    // 默认使用的是CursorFloatDiv,代码可以简写如下:  
    const cursorInfo = new CursorInfo(div, CursorFloatDiv);
    // 以上代码相当于:
    // 用户可以定义自己的类,类似CursorFloatDiv
    class CursorFloatDiv extends PosFloatDiv {
    constructor() {
    super()

    this.contentDiv.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
    this.contentDiv.style.borderRadius = '3px';
    this.contentDiv.style.color = 'rgb(255, 255, 255)';
    this.contentDiv.style.padding = '1px 5px 1px 5px';
    this.contentDiv.style.fontSize = '12px';
    this.contentDiv.style.whiteSpace = 'nowrap';

    this.contentDiv.innerText = `未定义光标信息!`;
    this.originRatioX = 0;
    this.originRatioY = 0;
    this.originOffsetX = -16;
    }
    }
    const cursorInfo = new CursorInfo<CursorFloatDiv>(div, CursorFloatDiv);

    类型参数

    层级 (查看层级一览)

    索引

    构造函数

    属性

    _lastMemId: number = -1

    访问器

    • get cursorDiv(): DivPoi<DivClass>

      返回 DivPoi<DivClass>

    • get disposers(): (() => void)[]

      返回 (() => void)[]

    • get memId(): number

      返回 number

    • get show(): boolean

      返回 boolean

    • set show(value: boolean): void

      参数

      • value: boolean

      返回 void

    • get showChanged(): Listener<[boolean, boolean]>

      返回 Listener<[boolean, boolean]>

    • get text(): string

      返回 string

    • set text(value: string): void

      参数

      • value: string

      返回 void

    • get toDestroyEvent(): Listener

      返回 Listener

    方法

    • 参数

      • disposeFunc: () => void

      返回 () => void

    • 类型参数

      • T extends { destroy(): void }

      参数

      • obj: T

      返回 T

    • 参数

      • disposeFunc: () => void

      返回 () => void

    • 类型参数

      • T extends { destroy(): void }

      参数

      • obj: T

      返回 T

    • 参数

      • disposeFunc: () => void

      返回 () => void

    • 返回 undefined

    • 请不要重写destroy,请使用destroyImp来重写!

      返回 undefined

    • 返回 void

    • 参数

      • disposeFunc: () => void

      返回 () => void

    • 类型参数

      • T extends { destroy(): void }

      参数

      • obj: T

      返回 T

    • 类型参数

      • T extends { destroy(): void }

      参数

      • obj: T

      返回 T

    • 返回 boolean

    • 返回 boolean

    • 返回 void

    • 类型参数

      • T extends { tryDestroy(): void }

      参数

      • obj: T

      返回 T

    • 返回 undefined

    • 类型参数

      • T extends { tryDestroy(): void }

      参数

      • obj: T

      返回 T