UNPKG

@glowjs/core

Version:

GlowJS数字孪生引擎核心库。

139 lines (138 loc) 3.25 kB
import { App } from "../../core/App"; import { Entity } from "../Entity"; import { Container } from "./Container"; import { Point2D } from "../../misc"; /** * POI加强版 */ export declare class POIPlus extends Entity { /** 容器 */ container: Container; /** * 父物体计算包围盒时是否排除此物体,默认排除 */ excludeBoundingBox: boolean; /** * 模式 */ mode: '2D' | '3D'; /** * 宽度 */ width: number; /** * 高度 */ height: number; /** * 像素宽度 */ pixWidth: number; /** * 是否默认隐藏 */ defaultHidden: boolean; /** * 链接ID */ linkId: string | null; /** * Base64图片 */ base64: string; /** * Base64图片原始宽度 */ srcWidth: number; /** * Base64图片原始高度 */ srcHeight: number; /** * 像素高度 */ pixHeight: number; private _img2D; private _canvas; private _pointerClickObserver; private _pointerEnterObserver; private _pointerLeaveObserver; private _pointerDownObserver; private _pointerUpObserver; private _mesh; private _showBoundingBox; private _visible; private _pivot; /** * 上一次点击的时间点,用于计算双击事件 */ private _lastClickTime; /** * 构造函数 * @param app 应用 */ constructor(app: App); get visible(): boolean; set visible(value: boolean); /** * 获取或设置轴心点 */ get pivot(): Point2D; set pivot(value: Point2D); get pickable(): boolean; set pickable(value: boolean); get cursor(): string; set cursor(value: string); get showBoundingBox(): boolean; set showBoundingBox(value: boolean); /** * 获取或设置贴图ID */ get textureId(): string; build(force?: boolean): Promise<void>; unbuild(): void; toJson(): any; fromJson(json: any): void; private _build2D; private _onResize; private _build3D; private _updatePovit; dispose(): void; /** * 获取原始贴图的像素大小,编辑器中用来实现等比缩放 */ get _ssize(): Point2D; /** * 计算内容大小(编辑器用) */ _calaculateContentSize(): Point2D; /** * 获取或设置所有文本 */ get txts(): string[]; set txts(value: string[]); /** * 获取或设置所有文本的颜色 */ get txtColors(): string[]; set txtColors(value: string[]); /** * 设置单个文本内容 * @param index 索引 * @param value 文本内容 */ setTxtValue(index: number, value: string): void; /** * 设置单个文本颜色 * @param index 索引 * @param color 颜色 */ setTxtColor(index: number, color: string): void; /** * 设置单个文本 * @param index 索引 * @param value 文本内容 * @param color 颜色 */ setTxt(index: number, value: string, color: string): void; }