新增文本框控件,空间框架略微修改适配文本输入

This commit is contained in:
MrZ626
2020-10-19 00:58:49 +08:00
parent 10d65c4581
commit 97ace858af
6 changed files with 184 additions and 54 deletions

View File

@@ -171,7 +171,9 @@ function love.touchreleased(id,x,y)
WIDGET.press(x,y)
WIDGET.release(x,y)
touching=nil
WIDGET.sel=nil
if WIDGET.sel and not WIDGET.sel.keepFocus then
WIDGET.sel=nil
end
end
if touchUp[SCN.cur]then
touchUp[SCN.cur](id,x,y)
@@ -253,6 +255,11 @@ function love.keyreleased(i)
if SCN.swapping then return end
if keyUp[SCN.cur]then keyUp[SCN.cur](i)end
end
function love.textinput(text)
if WIDGET.sel and WIDGET.sel.type=="textBox"then
WIDGET.sel.value=WIDGET.sel.value..text
end
end
function love.joystickadded(JS)
joysticks[#joysticks+1]=JS