创建提示数据实例
- Source
Members
(nullable) drag :boolean
启用拖拽
如果是 true, 则启用 tips 元素的拖拽, 否则不启用拖拽
Type:
- boolean
- Default Value
- true
- Source
(nullable) duration :number
持续时间
提示框显示时的持续时间, 单位 ms
Type:
- number
- Default Value
- 3000
- Source
(nullable) interval :number
隐藏时间
提示框隐藏时的持续时间, 单位 ms
Type:
- number
- Default Value
- 5000
- Source
(nullable) message :Array.<DMessage>
消息数组
播放的消息内容, 需要是一个字符串数组, 播放时会从中随机取出一条进行提示, 空数组则不播放, 默认为空数组
Type:
- Array.<DMessage>
- Default Value
- []
- Source
[
{
"text": "好久不见,日子过得好快呢……"
},
{
"text": "大坏蛋!你都多久没理人家了呀,嘤嘤嘤~"
},
{
"type": "seasons",
"date": "01/01",
"text": "<span>元旦</span>了呢,新的一年又开始了,今年是{year}年~"
},
{
"type": "hour",
"hour": "6-7",
"text": "早上好!一日之计在于晨,美好的一天就要开始了~"
},
{
"type": "event",
"event": "console",
"text": "哈哈,你打开了控制台,是想要看看我的小秘密吗?"
},
]
(nullable) minHeight :number
最小高度
提示框最小高度, 单位 px
Type:
- number
- Default Value
- 100
- Source
(nullable) minWidth :number
最小宽度
提示框最小宽度, 单位 px
Type:
- number
- Default Value
- 230
- Source
(nullable) motionMessage :boolean
启用 motion 消息
控制是否启用 motion 消息, true: 启用, false: 关闭
Type:
- boolean
- Default Value
- true
- Source
(nullable) offsetX :number
x 偏移量
调整提示框位于舞台中的 x 轴方向偏移量
Type:
- number
- Default Value
- 0
- Source
(nullable) offsetY :number
y 偏移量
调整提示框位于舞台中的 y 轴方向偏移量
Type:
- number
- Default Value
- 0
- Source
(nullable) talk :boolean
随机说话
true: 启用随机说话
Type:
- boolean
- Default Value
- true
- Source
(nullable) talkApis :Array.<TTalkApi>
talk api 对象
用于存储 url 以及处理 talk 结果的对象
Type:
- Array.<TTalkApi>
- Default Value
- []
- Source
[
{
url: 'https://v1.hitokoto.cn/',
handle: async (res) => (await res.json()).hitokoto
},
{
url: 'https://v.api.aa1.cn/api/yiyan/index.php',
handle: async (res) => (await res.text()).match(/<p>(.*)<\/p>/)[1]
},
{
url: 'https://tenapi.cn/v2/yiyan',
handle: async res => await res.text()
}
]
(nullable) talkInterval :number
说话间隔
随机说话的时间间隔, 单位 ms
Type:
- number
- Default Value
- 30s
- Source