uievent runtime
This commit is contained in:
parent
304bd80bbc
commit
a6f3e18efc
@ -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窗口,返回游戏。
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user