uievent runtime

This commit is contained in:
oc 2019-05-26 14:10:17 +08:00
parent 304bd80bbc
commit a6f3e18efc
4 changed files with 15 additions and 1 deletions

View File

@ -1695,6 +1695,13 @@ core.drawImage(name, image, x, y, w, h, x1, y1, w1, h1)
http://www.w3school.com.cn/html5/canvas_drawimage.asp
这里的image允许传一个图片画布。也允许传递图片名将从你导入的图片中获取图片内容。
core.drawIcon(name, id, x, y, w, h)
在一张画布上绘制一个图标。
id为注册过的图标ID也可以使用状态栏的图标ID例如lv, hp, up, save, settings等。
x和y为绘制的左上角坐标w和h可选为绘制的宽高如果不填或null则使用该图标的默认宽高。
// ------ 具体的某个UI界面的绘制 ------ //
core.closePanel()
结束一切事件和UI绘制关闭UI窗口返回游戏。

View File

@ -164,6 +164,7 @@ control.prototype._animationFrame_selector = function (timestamp) {
if (opacity > 0.95 || opacity < 0.55)
core.animateFrame.selectorUp = !core.animateFrame.selectorUp;
core.setOpacity("_selector", opacity);
core.setOpacity("_uievent_selector", opacity);
core.animateFrame.selectorTime = timestamp;
}

View File

@ -1621,7 +1621,7 @@ events.prototype._action_exit = function (data, x, y, prefix) {
}
events.prototype._action_previewUIEvent = function (data, x, y, prefix) {
this.insert(data.action);
this.insertAction(data.action);
core.doAction();
}

View File

@ -553,6 +553,12 @@ ui.prototype.drawWindowSelector = function(background, x, y, w, h) {
}
ui.prototype._uievent_drawSelector = function (data) {
if (data.x == null || data.y == null || data.width == null || data.height == null) {
if (main.mode != 'editor')
core.deleteCanvas('_uievent_selector');
return;
}
var background = data.background || core.status.textAttribute.background;
if (typeof background != 'string') return;
var x = core.calValue(data.x), y = core.calValue(data.y), w = core.calValue(data.width), h = core.calValue(data.height);