mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
TEST
This commit is contained in:
@@ -8,7 +8,12 @@ function TouchConfigScene:update()
|
||||
-- TODO
|
||||
end
|
||||
|
||||
local test_button = BUTTON.new('PHÍM THỬ - Chọn widget', 50, 50, 200, 30)
|
||||
local test_button = BUTTON.new{
|
||||
name = 'PHÍM THỬ - Chọn widget',
|
||||
x = 50, y = 50, w = 200, h = 30, textColor = {1,1,1,1},
|
||||
codeWhenPressed = function() PlaySE("promote") end,
|
||||
codeWhenReleased = function() PlaySE("lock") end,
|
||||
}
|
||||
|
||||
local function drawButtons()
|
||||
-- drawText('Select button', 10, 10, 100, 'center')
|
||||
@@ -16,7 +21,6 @@ local function drawButtons()
|
||||
-- love.graphics.setLineWidth(3)
|
||||
-- love.graphics.rectangle('line',0,0,120,40)
|
||||
test_button:draw()
|
||||
|
||||
end
|
||||
|
||||
function TouchConfigScene:render()
|
||||
@@ -24,8 +28,18 @@ function TouchConfigScene:render()
|
||||
drawButtons()
|
||||
end
|
||||
|
||||
function TouchConfigScene:onInputMove(e)
|
||||
if e.type == "mouse" then
|
||||
test_button:isHovering(e.x, e.y)
|
||||
end
|
||||
end
|
||||
function TouchConfigScene:onInputPress(e)
|
||||
if e.input == 'menu_back' then SCENE = InputConfigScene() end
|
||||
if e.type == 'mouse' then test_button:press() end
|
||||
if e.type == 'touch' then test_button:press(true) end
|
||||
end
|
||||
function TouchConfigScene:onInputRelease(e)
|
||||
if e.type == 'mouse' then test_button:press() end
|
||||
end
|
||||
|
||||
return TouchConfigScene
|
||||
Reference in New Issue
Block a user