mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Moving VCTRL related calls and adding buttons for name entry screen
This commit is contained in:
17
main.lua
17
main.lua
@@ -97,8 +97,6 @@ function love.draw()
|
||||
love.graphics.push()
|
||||
|
||||
SCENE:render()
|
||||
VCTRL.draw()
|
||||
|
||||
-- -- Grid system
|
||||
-- local grid_width, grid_height = 40, 20
|
||||
-- love.graphics.replaceTransform(GLOBAL_TRANSFORM)
|
||||
@@ -114,10 +112,6 @@ function love.draw()
|
||||
-- love.graphics.line(0, grid_height * iy, 640, grid_height * iy)
|
||||
-- end
|
||||
|
||||
love.graphics.setColor(0, 0, 0, 0.8)
|
||||
love.graphics.rectangle("fill", 10, 445, 400, 30)
|
||||
drawText("X: "..(LAST_X_POSITION or "--------").."; Y: "..(LAST_Y_POSITION or "--------"), 10, 455, 400, "left")
|
||||
|
||||
love.graphics.pop()
|
||||
end
|
||||
|
||||
@@ -142,22 +136,15 @@ end
|
||||
|
||||
function love.touchpressed(id,x,y)
|
||||
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
||||
if not VCTRL.press(x,y,id) then
|
||||
SCENE:onInputPress{type = "touch", x = x, y = y, dx = 0, dy = 0, id = id}
|
||||
end
|
||||
end
|
||||
function love.touchdragged(id,x,y,dx,dy)
|
||||
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
||||
if not VCTRL.drag(x,y,id) then
|
||||
SCENE:onInputDrag{type = "touch", x = x, y = y, dx = dx, dy = dy, id = id}
|
||||
end
|
||||
SCENE:onInputDrag{type = "touch", x = x, y = y, dx = dx, dy = dy, id = id}
|
||||
end
|
||||
function love.touchreleased(id,x,y)
|
||||
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
||||
if not VCTRL.release(id) then
|
||||
SCENE:onInputRelease{type = "touch", x = x, y = y, dx = 0, dy = 0, id = id}
|
||||
LAST_X_POSITION, LAST_Y_POSITION = x, y
|
||||
end
|
||||
SCENE:onInputRelease{type = "touch", x = x, y = y, dx = 0, dy = 0, id = id}
|
||||
end
|
||||
|
||||
function love.keypressed(key, scancode)
|
||||
|
||||
Reference in New Issue
Block a user