Billboard
大约 1 分钟
Billboard
继承自Thing,拥有Thing
、THREE.Object3D
一切属性和方法。
构造器
new VT.Billboard({
// 是否避让
avoid: false,
// 中心点对齐
center: [0.5, 0],
material: {
// 透明
transparent: true,
// 标注内容贴图生成
map: {
// 图标
icon: "",
// 图标可见性
iconVisible: true,
// 图标位置
iconPosition: "left",
// 图标宽度
iconWidth: 32,
// 图标高度
iconHeight: 32,
// 图标旋转角度 deg
iconRotate: 0,
// 图标间距
iconMargin: 4,
// 文字
text: "",
// 文字大小
fontSize: 14,
// 文字颜色
fontColor: "#111111",
// 字体
fontFamily: 'Microsoft Yahei, Times, serif',
// 加粗
fontWeight: "normal",
// 斜体
fontVariant: "normal",
// 行间距
lineGap: 6,
// 内边距
padding: 4,
// 文字对齐
textAlign: "left",
// 文字可见性
textVisible: true,
// 偏移X
offsetX: 0,
// 偏移Y
offsetY: 0,
// 描边
strokeWidth: 1,
// 描边颜色
strokeColor: "#FFFFFF",
// 是否填充
fill: false,
// 填充颜色
fillColor: "#000000",
// 外边框
outlineWidth: 0,
// 外边框颜色
outlineColor: "#FFFFFF",
// 强制高宽2的幂次方
forcePowerOf2: false,
}
},
})
属性成员
sprite
- 类型:
{THREE.Sprite}
精灵对象
center
- 类型:
{THREE.Vector2}
中心点
spriteComputeParameter
- 类型:
{Number}
位置计算参数
texture
- 类型:
{THREE.CanvasTexture}
贴图
avoid
- 类型:
{Boolean}
是否避让
方法
getSize
获取像素大小
- getSize()
- 类型:
Function
- 参数:无
- 返回:
{Object}
{width, height}
updateScale
更新比例
- updateScale()
- 类型:
Function
- 参数:无
- 返回:无