Scroll Text
This commit is contained in:
parent
95ccc2574b
commit
7256878408
@ -288,8 +288,8 @@ time为可选项,代表该自动文本的时间。可以不指定,不指定
|
||||
``` js
|
||||
"x,y": [ // 实际执行的事件列表
|
||||
{"type": "setText", "title": [255,0,0], "text": [255,255,0], "background": [0,0,255,0.3]},
|
||||
{"type": "setText", "position": "up", "bold": true, "scroll": 70},
|
||||
"这段话将显示在上方,标题为红色,正文为黄色粗体,背景为透明度0.3的蓝色,70毫秒速度滚动"
|
||||
{"type": "setText", "position": "up", "bold": true, "time": 70},
|
||||
"这段话将显示在上方,标题为红色,正文为黄色粗体,背景为透明度0.3的蓝色,70毫秒速度打字机效果"
|
||||
]
|
||||
```
|
||||
|
||||
@ -303,7 +303,7 @@ position为可选项,表示设置文字显示位置。只能为up(上),c
|
||||
|
||||
bold为可选项,如果设置则为true或false,表示正文是否使用粗体。 默认值:`false`
|
||||
|
||||
scroll为可选项,表示文字滚动的速度。若此项设置为0将直接全部显示,若大于0则会设置为相邻字符依次显示的时间间隔。 默认值:`50`
|
||||
time为可选项,表示文字滚动的速度。若此项设置为0将直接全部显示,若大于0则会设置为相邻字符依次显示的时间间隔。 默认值:`50`
|
||||
|
||||
### tip:显示一段提示文字
|
||||
|
||||
|
||||
@ -132,7 +132,7 @@ function core() {
|
||||
"background": [0,0,0,0.85],
|
||||
"text": [255,255,255,1],
|
||||
"bold": false,
|
||||
"scroll": 50,
|
||||
"time": 50,
|
||||
},
|
||||
'curtainColor': null,
|
||||
'usingCenterFly':false,
|
||||
|
||||
@ -328,8 +328,8 @@ events.prototype.doAction = function() {
|
||||
if (core.isset(data.bold)) {
|
||||
core.status.textAttribute.bold=data.bold;
|
||||
}
|
||||
if (core.isset(data.scroll)) {
|
||||
core.status.textAttribute.scroll=data.scroll;
|
||||
if (core.isset(data.time)) {
|
||||
core.status.textAttribute.time=data.time;
|
||||
}
|
||||
core.events.doAction();
|
||||
break;
|
||||
|
||||
@ -242,7 +242,7 @@ ui.prototype.drawTextBox = function(content) {
|
||||
|
||||
}
|
||||
|
||||
if (textAttribute.scroll<=0 || core.status.event.id!='action') {
|
||||
if (textAttribute.time<=0 || core.status.event.id!='action') {
|
||||
drawContent(content);
|
||||
}
|
||||
else {
|
||||
@ -252,7 +252,7 @@ ui.prototype.drawTextBox = function(content) {
|
||||
if (index==content.length) {
|
||||
clearInterval(core.status.event.interval);
|
||||
}
|
||||
}, textAttribute.scroll);
|
||||
}, textAttribute.time);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user