Interface SpriteMarkerOptions

interface SpriteMarkerOptions {
    allowOverlap?: boolean;
    anchorX?: number | "left" | "center" | "right";
    anchorY?: number | "top" | "bottom" | "center";
    collideGroupName?: string;
    collideId?: string;
    collideZIndex?: number;
    expandRect?: number | [number, number, number, number];
    fadeDistance?: number;
    height?: number;
    material?: SpriteMaterial;
    materialParameters?: SpriteMaterialParameters;
    offsetX?: number;
    offsetY?: number;
    position: [number, number, number] | Vector3;
    refreshRenderThrottleTimeout?: number;
    renderTexture?: Render2dTextureOptions;
    rotation?: number;
    sizeAttenuation?: boolean;
    texture?: Texture;
    width?: number;
}

Properties

allowOverlap?: boolean

是否允许重叠

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

x对齐方式

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

y对齐方式

collideGroupName?: string

碰撞监测组名 会对同一个组名内的进行碰撞检测

collideId?: string

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

collideZIndex?: number

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

expandRect?: number | [number, number, number, number]

自动尺寸时,获取矩形大小时,额外扩展的范围 (左上,,左下y, 右x,右下y)

fadeDistance?: number

透明度随相机距离大小

height?: number

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

material?: SpriteMaterial

材质

materialParameters?: SpriteMaterialParameters

材质参数

offsetX?: number

x偏移

offsetY?: number

y偏移

position: [number, number, number] | Vector3

位置

refreshRenderThrottleTimeout?: number

更新材质节流时间毫秒,默认20

renderTexture?: Render2dTextureOptions

使用渲染材质

rotation?: number

旋转角度(0-360)

sizeAttenuation?: boolean

是否使用大小衰减(根据相机远近自动调整点的大小) false的话,表示用像素大小,true表示世界坐标

texture?: Texture

直接使用材质(当此项有值时renderTexture将无效)

width?: number

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