Interface SpriteTextItem

精灵文本某项数据

interface SpriteTextItem {
    anchorX?: number | "left" | "center" | "right";
    anchorY?: number | "top" | "bottom" | "center";
    autoCanvasSize?: boolean;
    collideId?: string;
    collideZIndex?: number;
    height?: number;
    highlightMaterial?: SpriteMaterial;
    highlightStyle?: TextStyleProps;
    id?: string;
    material: SpriteMaterial;
    object: SpriteMarker;
    offsetX?: number;
    offsetY?: number;
    position: [number, number, number] | Vector3;
    rotation?: number;
    sharedCanvas?: boolean;
    style?: TextStyleProps;
    text: string;
    width?: number;
}

Hierarchy (view full)

Properties

anchorX?: number | "left" | "center" | "right"

x对齐方式

anchorY?: number | "top" | "bottom" | "center"

y对齐方式

autoCanvasSize?: boolean

是否根据绘制的内容计算渲染的大小 默认true

collideId?: string

同一个id会一起显示和隐藏

collideZIndex?: number

碰撞检测时的zindex,值越大,越往上

height?: number

高(sizeAttenuation为false是文本像素大小,否则表示世界坐标制图高)

highlightMaterial?: SpriteMaterial
highlightStyle?: TextStyleProps

高亮时的文本样式

id?: string

id

material: SpriteMaterial
object: SpriteMarker
offsetX?: number

x偏移

offsetY?: number

y偏移

position: [number, number, number] | Vector3

位置

rotation?: number

旋转角度(0-360)

sharedCanvas?: boolean

是否为了提高效率共享一个canvas 默认true

文本样式

text: string

文本

width?: number

宽(sizeAttenuation为false是文本像素大小,否则表示世界坐标宽度)