Class: SpriteLabelPlugin

SpriteLabelPlugin()

三维Sprite Label,只支持最基本的文字展示

Constructor

new SpriteLabelPlugin()

Methods

addLabel(option)

新增标签
Parameters:
Name Type Description
option Object
Example
参数说明
{
     id:Number 标签对象的ID,可以通过该ID来删除标签 
     text:文字 
     position:位置,BIMI.THREE.Vecotr3
     fontSize:字体css,默认:'14px' 
     fontColor:文字颜色,默认:'#ffffff' 
     backgroundColor: 标签背景色,默认:'#485663' 
     borderColor:标签边框色,默认:'#ffffff' 
     zoom:是否跟随视距缩放 默认 false
     bindData:object 业务绑定数据,可以在pick的时候返回 
     distance:Number 视距 
}

getLabel(id)

获得标签对象,返回的是THREE.Sprite
Parameters:
Name Type Description
id * label id

removeAll()

三维标签update太麻烦了,必须重绘canvas,也要重新计算zoom,不如全部清除重新添加

removeLabel(id)

移除Sprite
Parameters:
Name Type Description
id *

setVisible(id, visible)

设置某个标签可见性
Parameters:
Name Type Description
id *
visible *

updateContent(id, options)

修改既有Label的内容dom
Parameters:
Name Type Description
id * lable id
options *
Example
数据定义
{
     text: 文本,不设置就使用既有值
     fontSize:字体css,不设置就使用既有值
     fontColor:文字颜色,不设置就使用既有值
     backgroundColor: 标签背景色,不设置就使用既有值
     borderColor:标签边框色,不设置就使用既有值
}

updatePosition(id, position)

修改既有Label的位置
Parameters:
Name Type Description
id * lable id
position * 位置,BIMI.THREE.Vector3