场景&事件系统重写

This commit is contained in:
MrZ626
2020-12-04 19:35:33 +08:00
parent 0b2abf71ea
commit 8a754431cf
48 changed files with 546 additions and 352 deletions

View File

@@ -15,7 +15,9 @@ local function sendMessage()
end
end
function sceneInit.chat()
local scene={}
function scene.sceneInit()
BG.set("none")
wsConnect(
TICK.wsCONN_connect,
@@ -23,7 +25,7 @@ function sceneInit.chat()
)
end
function keyDown.chat(k)
function scene.keyDown(k)
if k=="return"then
sendMessage()
elseif k=="escape"then
@@ -33,8 +35,10 @@ function keyDown.chat(k)
end
end
WIDGET.init("chat",{
scene.widgetList={
WIDGET.newTextBox{name="text", x=40, y=500,w=980,h=180,font=40},
WIDGET.newButton{name="send", x=1140, y=540,w=170,h=80,font=40,code=sendMessage},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=WIDGET.lnk_BACK},
})
}
return scene