From d7cc69b2fe5db4174fa3f0fd0c5409371e4ea1d8 Mon Sep 17 00:00:00 2001 From: "Squishy (C6H12O6+NaCl+H2O)" <106439598+SweetSea-ButImNotSweet@users.noreply.github.com> Date: Wed, 22 May 2024 00:27:11 +0700 Subject: [PATCH] TEST --- conf.lua | 4 +++- main.lua | 12 ++++-------- scene/touch_config.lua | 1 - 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/conf.lua b/conf.lua index de55417..e175f51 100644 --- a/conf.lua +++ b/conf.lua @@ -2,10 +2,12 @@ function love.conf(t) t.identity = "tromi_ver3" t.externalstorage=true --- t.console = true + t.console = true t.window.title = "Tromi" t.window.width = 1280 t.window.height = 960 t.window.vsync = false + + t.accelerometerjoystick = true end diff --git a/main.lua b/main.lua index b9752bc..4c5a21b 100644 --- a/main.lua +++ b/main.lua @@ -114,10 +114,9 @@ function love.draw() -- love.graphics.line(0, grid_height * iy, 640, grid_height * iy) -- end - -- drawText( - -- "Pressed: "..(LastPressedKey or '[NONE]').." | Released: "..(LastReleasedKey or '[NONE]'), - -- 0,0,1000,"left" - -- ) + love.graphics.setColor(0, 0, 0, 0.8) + love.graphics.rectangle("fill", 10, 445, 200, 30) + drawText("X: "..(LAST_X_POSITION or "-").."; Y: "..(LAST_Y_POSITION or "-"), 10, 455, 200, "left") love.graphics.pop() end @@ -158,6 +157,7 @@ function love.touchreleased(id,x,y) if not VCTRL.release(id) then SCENE:onInputRelease{type = "touch", x = x, y = y, dx = 0, dy = 0, id = id} end + LAST_X_POSITION, LAST_Y_POSITION = x, y end function love.keypressed(key, scancode) @@ -183,8 +183,6 @@ function love.keypressed(key, scancode) end SCENE:onInputPress{input=input_pressed, type="key", key=key, scancode=scancode} end - - LastPressedKey = input_pressed or scancode end function love.keyreleased(key, scancode) @@ -203,8 +201,6 @@ function love.keyreleased(key, scancode) end SCENE:onInputRelease{input=input_released, type="key", key=key, scancode=scancode} end - - LastReleasedKey = input_released or scancode end function love.joystickpressed(joystick, button) diff --git a/scene/touch_config.lua b/scene/touch_config.lua index ef97fe5..7ebad83 100644 --- a/scene/touch_config.lua +++ b/scene/touch_config.lua @@ -84,7 +84,6 @@ end ---@param e SCENE_onInput function TouchConfigScene:onInputRelease(e) if e.type == "mouse" or e.type == "touch" then - error() BUTTON.release(buttonList, e.x, e.y) end end