147 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
			
		
		
	
	
			147 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
| import { Color } from "three";
 | |
| import McGiWorldDraw from "../McGiWorldDraw";
 | |
| import MxDbEntity from "../MxDbEntity";
 | |
| import drawMxDbText from "./draw";
 | |
| import { SpriteTextObj, SpriteTextColorType, TextFontWeight } from "./SpriteText";
 | |
| /**
 | |
|  * MxDbText 绘制文字
 | |
|  * @describe 适用于标签标注类型的文字(永远面向相机的平面)
 | |
|  * @example
 | |
|  * ``` js
 | |
|  *  obj = new MxDbText()
 | |
|     obj.rxInit()
 | |
|     obj.position = new THREE.Vector3()
 | |
|     obj.backgroundColor = '#ff0000'
 | |
|     obj.padding = 5
 | |
|     obj.strokeWidth = 3
 | |
|     obj.strokeColor = "#3a8bd2"
 | |
|     obj.borderColor = "#ff00ff"
 | |
|     obj.borderWidth = 2
 | |
|     obj.borderRadius = 2
 | |
|     obj.opacity = 0.8
 | |
|     obj.text  = 'This is\nsome multi-line\ntext'
 | |
|     obj.height = 100000
 | |
|     obj.color = "#fff000"
 | |
|  * ```
 | |
|  */
 | |
| export declare class MxDbText extends MxDbEntity {
 | |
|     static cmd: string;
 | |
|     static draw: typeof drawMxDbText;
 | |
|     /** 文字所在位置*/
 | |
|     position: import("three").Vector3;
 | |
|     setPosition(position: THREE.Vector3): this;
 | |
|     private _text;
 | |
|     /** 文字内容*/
 | |
|     get text(): string;
 | |
|     set text(text: string);
 | |
|     setText(text: string): this;
 | |
|     private _height;
 | |
|     /** 文字高度*/
 | |
|     get height(): number;
 | |
|     set height(height: number);
 | |
|     setHeight(height: number): this;
 | |
|     private _backgroundColor;
 | |
|     /** 背景颜色 */
 | |
|     get backgroundColor(): SpriteTextColorType;
 | |
|     set backgroundColor(color: SpriteTextColorType);
 | |
|     setBackgroundColor(backgroundColor: SpriteTextColorType): this;
 | |
|     private _padding;
 | |
|     /** 填充范围 */
 | |
|     get padding(): number | number[];
 | |
|     set padding(padding: number | number[]);
 | |
|     setPadding(padding: number | number[]): this;
 | |
|     private _borderWidth;
 | |
|     /** 边框宽度 */
 | |
|     get borderWidth(): number;
 | |
|     set borderWidth(borderWidth: number);
 | |
|     setBorderWidth(borderWidth: number): this;
 | |
|     private _borderRadius;
 | |
|     /** 边框圆角 */
 | |
|     get borderRadius(): number;
 | |
|     set borderRadius(borderRadius: number);
 | |
|     setBorderRadius(borderRadius: number): this;
 | |
|     private _borderColor;
 | |
|     /** 边框颜色 */
 | |
|     get borderColor(): SpriteTextColorType;
 | |
|     set borderColor(borderColor: SpriteTextColorType);
 | |
|     setBorderColor(borderColor: SpriteTextColorType): this;
 | |
|     private _fontFace;
 | |
|     /** 客户端字体 */
 | |
|     get fontFace(): string;
 | |
|     set fontFace(fontFace: string);
 | |
|     setFontFace(fontFace: string): this;
 | |
|     private _fontSize;
 | |
|     /** 字体大小 */
 | |
|     get fontSize(): number;
 | |
|     set fontSize(fontSize: number);
 | |
|     setFontSize(fontSize: number): this;
 | |
|     private _fontWeight;
 | |
|     /** 字体粗细 */
 | |
|     get fontWeight(): TextFontWeight;
 | |
|     set fontWeight(fontWeight: TextFontWeight);
 | |
|     setFontWeight(fontWeight: TextFontWeight): this;
 | |
|     private _strokeWidth;
 | |
|     /** 笔划宽度 */
 | |
|     get strokeWidth(): number;
 | |
|     set strokeWidth(strokeWidth: number);
 | |
|     setStrokeWidth(strokeWidth: number): this;
 | |
|     private _strokeColor;
 | |
|     /** 笔划颜色 */
 | |
|     get strokeColor(): SpriteTextColorType;
 | |
|     set strokeColor(strokeColor: SpriteTextColorType);
 | |
|     setStrokeColor(strokeColor: SpriteTextColorType): this;
 | |
|     private _textAlign;
 | |
|     /** 文本格式 */
 | |
|     get textAlign(): CanvasTextAlign;
 | |
|     set textAlign(textAlign: CanvasTextAlign);
 | |
|     setTextAlign(textAlign: CanvasTextAlign): this;
 | |
|     private _textShadowBlur;
 | |
|     /** 文字阴影模糊程度 */
 | |
|     get textShadowBlur(): number;
 | |
|     set textShadowBlur(textShadowBlur: number);
 | |
|     setTextShadowBlur(textShadowBlur: number): this;
 | |
|     private _textShadowColor;
 | |
|     /**  文字阴影颜色*/
 | |
|     get textShadowColor(): string | number | Color | undefined;
 | |
|     set textShadowColor(textShadowColor: string | number | Color | undefined);
 | |
|     setTextShadowColor(textShadowColor: string | number | Color | undefined): this;
 | |
|     private _textShadowOffsetX;
 | |
|     /** 文字阴影X轴偏移量 */
 | |
|     get textShadowOffsetX(): number;
 | |
|     set textShadowOffsetX(textShadowOffsetX: number);
 | |
|     setTextShadowOffsetX(textShadowOffsetX: number): this;
 | |
|     private _textShadowOffsetY;
 | |
|     /** 文字阴影X轴偏移量 */
 | |
|     get textShadowOffsetY(): number;
 | |
|     set textShadowOffsetY(textShadowOffsetY: number);
 | |
|     setTextShadowOffsetY(textShadowOffsetY: number): this;
 | |
|     private _angle;
 | |
|     /** 角度*/
 | |
|     get angle(): number;
 | |
|     set angle(angle: number);
 | |
|     setAngle(angle: number): this;
 | |
|     private _scale;
 | |
|     /** 缩放倍数 */
 | |
|     get scale(): number;
 | |
|     set scale(scale: number);
 | |
|     setScale(scale: number): this;
 | |
|     private _underline;
 | |
|     /** 下划线 */
 | |
|     get underline(): boolean;
 | |
|     set underline(underline: boolean);
 | |
|     setUnderline(underline: boolean): void;
 | |
|     /** SpriteText实例 */
 | |
|     protected spriteText: SpriteTextObj;
 | |
|     getTypeName(): string;
 | |
|     worldDraw(pWorldDraw: McGiWorldDraw): void;
 | |
|     /**创建精灵文字对象 */
 | |
|     protected createSpriteText(): void;
 | |
|     getGripPoints(): THREE.Vector3[];
 | |
|     moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
 | |
|     create(): MxDbEntity;
 | |
|     dwgIn(obj: any): boolean;
 | |
|     dwgOut(obj: any): object;
 | |
|     getGeomExtents(): THREE.Box3 | null;
 | |
|     erase(): boolean;
 | |
| }
 |