Scroll Text

This commit is contained in:
ckcz123 2018-02-28 16:38:37 +08:00
parent 95ccc2574b
commit 7256878408
4 changed files with 8 additions and 8 deletions

View File

@ -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为可选项表示设置文字显示位置。只能为upc
bold为可选项如果设置则为true或false表示正文是否使用粗体。 默认值:`false`
scroll为可选项表示文字滚动的速度。若此项设置为0将直接全部显示若大于0则会设置为相邻字符依次显示的时间间隔。 默认值:`50`
time为可选项表示文字滚动的速度。若此项设置为0将直接全部显示若大于0则会设置为相邻字符依次显示的时间间隔。 默认值:`50`
### tip显示一段提示文字

View File

@ -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,

View File

@ -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;

View File

@ -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);
}
}