-
Notifications
You must be signed in to change notification settings - Fork 11
bulletScreen 结构
scottxu edited this page Jan 7, 2019
·
12 revisions
bulletScreen 结构用于存放单条弹幕数据。
bulletScreen 结构具有以下字段:
字段 | 类型 | 默认值 | 说明 |
---|---|---|---|
id | 字符串型 | 无 | 弹幕的id |
text | 字符串型 | Empty | 弹幕文本 |
boxColor | 字符串型 | unll | 方框颜色:参照CSS颜色设置方法,为 null 不显示方框 |
speed | 浮点型 | 0.15 | 弹幕速度:单位:像素/毫秒,仅弹幕类型为0、1时有效 |
size | 整型 | 19 | 字体大小:单位:像素 |
color | 字符串型 | null | 弹幕颜色:参照CSS颜色设置方法,为 null 不显示此弹幕 |
borderColor | 字符串型 | null | 描边颜色:参照CSS颜色设置方法,为 null 没有描边 |
type | 整型 | 0 | 弹幕类型:0:从右到左(普通);1:从左到右(逆向);2:顶部固定;3:底部固定 |
startTime | 整型 | option.clock() | 弹幕进入时间:单位:毫秒,默认为时间基准(option.clock)当前时间 |
residenceTime | 整型 | 5000 | 弹幕停留时间:单位:毫秒,仅弹幕类型2、3时有效 |
canDiscard | 布尔型 | true | 是否允许丢弃:在弹幕过多时,程序将自动丢弃一些延迟过高的弹幕。此选项为 false 时本条弹幕无论如何都不会被丢弃,使用本选项的场景如本用户发送的弹幕。注意:不要将太多的弹幕的 canDiscard 设为 false, 否则会因超时的弹幕不会被丢弃而造成意外的问题 |
© 2018-2019 Scott Xu. All right reserved. | This project is an open source project and it is licensed under the MIT License.