This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-21 23:37:19 +07:00
parent 7d44fc81ed
commit bf54644287
3 changed files with 10 additions and 10 deletions

View File

@@ -120,7 +120,6 @@ function button:press(x, y)
end
---Trigger release action, don't need ``self._hovering`` to ``true``
function button:release(x, y)
error(self._pressed and "okay")
if self:isHovering(x, y) and self._pressed then
self._pressed = false
self.codeWhenReleased()

View File

@@ -129,7 +129,7 @@ end
function NameEntryScene:onInputPress(e)
if e.type == "mouse" or e.type == "touch" then
BUTTON.press(buttonList, e.x, e.y, e.type == "touch")
BUTTON.press(buttonList, e.x, e.y)
elseif e.input == "menu_decide" or e.input == "rotate_left" or e.scancode == "return" then
self.delete_confirm = false
self.delete_input_count = 0
@@ -199,7 +199,7 @@ end
function NameEntryScene:onInputRelease(e)
if e.type == "mouse" or e.type == "touch" then
BUTTON.release(buttonList, e.x, e.y, e.type == "touch")
BUTTON.release(buttonList, e.x, e.y)
elseif e.input == "left" or e.scancode == "left" or e.input == "right" or e.scancode == "right" then
self.direction = nil
self.repeat_counter = self.repeat_limit-1

View File

@@ -13,34 +13,34 @@ local buttonList = {
x = 10, y = 10, w = 120, h = 110
},
BUTTON.new{
zoom_negat = BUTTON.new{
text = "[—]\nSmaller",
x = 145, y = 10, w = 100, h = 50,
},
BUTTON.new{
zoom_reset = BUTTON.new{
text = "Size: 50\nTap to reset",
x = 255, y = 10, w = 100, h = 50,
},
BUTTON.new{
zoom_posit = BUTTON.new{
text = "[+]\nBigger",
x = 365, y = 10, w = 100, h = 50,
},
BUTTON.new{
opact_negat = BUTTON.new{
text = "[—]\nCan't see",
x = 145, y = 70, w = 100, h = 50,
},
BUTTON.new{
opact_reset = BUTTON.new{
text = "Opacity: 50%\nTap to reset",
x = 255, y = 70, w = 100, h = 50,
codeWhenReleased = function() PlaySE("autopromote") end
},
BUTTON.new{
opact_posit = BUTTON.new{
text = "[+]\nTotally see",
x = 365, y = 70, w = 100, h = 50,
},
BUTTON.new{
menu_back = BUTTON.new{
text = "SAVE and\nback to MENU",
x = 480, y = 10, w = 150, h = 50,
codeWhenReleased = function() SCENE = TitleScene() end
@@ -65,6 +65,7 @@ end
function TouchConfigScene:render()
MainBackground()
BUTTON.draw(buttonList)
drawBigText(buttonList.opact_reset._pressed and "okay" or "not", 400, 400, 100, "left")
end
---@param e SCENE_onInput