mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Update of touch configuration scene
This commit is contained in:
@@ -175,27 +175,27 @@ function Grid:update()
|
||||
end
|
||||
|
||||
function Grid:draw(greyscale, timer)
|
||||
love.graphics.setColor(0,0,0,1)
|
||||
love.graphics.rectangle("fill", 256, 31, 80, 45, 0, 0)
|
||||
love.graphics.setColor(0.3, 0.3, 0.3, 1)
|
||||
love.graphics.line(256,31,256,31+45)
|
||||
love.graphics.line(256,31,256+80,31)
|
||||
love.graphics.line(256+80,31,256+80,31+45)
|
||||
love.graphics.line(256,31+45,256+80,31+45)
|
||||
love.graphics.setColor(0,0,0,1)
|
||||
love.graphics.rectangle("fill", 256, 31, 80, 45, 0, 0)
|
||||
love.graphics.setColor(0.3, 0.3, 0.3, 1)
|
||||
love.graphics.line(256,31,256,31+45)
|
||||
love.graphics.line(256,31,256+80,31)
|
||||
love.graphics.line(256+80,31,256+80,31+45)
|
||||
love.graphics.line(256,31+45,256+80,31+45)
|
||||
for y = 1, self.height do
|
||||
for x = 1, self.width do
|
||||
if BLOCKS[self.grid[y][x].skin] and
|
||||
BLOCKS[self.grid[y][x].skin][self.grid[y][x].colour] then
|
||||
if self.grid[y][x].flash ~= nil then
|
||||
if self.grid[y][x].flash > 0 then
|
||||
love.graphics.setColor(0.4+(self.grid[y][x].flash*0.1), 0.4+(self.grid[y][x].flash*0.1), 0.4+(self.grid[y][x].flash*0.1), 1)
|
||||
love.graphics.draw(BLOCKS[self.grid[y][x].skin]['W'], 200+x*16, 64+y*16)
|
||||
self.grid[y][x].flash = self.grid[y][x].flash - 1
|
||||
else
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.draw(BLOCKS[self.grid[y][x].skin][self.grid[y][x].colour..'_d'], 200+x*16, 64+y*16)
|
||||
end
|
||||
end
|
||||
if self.grid[y][x].flash ~= nil then
|
||||
if self.grid[y][x].flash > 0 then
|
||||
love.graphics.setColor(0.4+(self.grid[y][x].flash*0.1), 0.4+(self.grid[y][x].flash*0.1), 0.4+(self.grid[y][x].flash*0.1), 1)
|
||||
love.graphics.draw(BLOCKS[self.grid[y][x].skin]['W'], 200+x*16, 64+y*16)
|
||||
self.grid[y][x].flash = self.grid[y][x].flash - 1
|
||||
else
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.draw(BLOCKS[self.grid[y][x].skin][self.grid[y][x].colour..'_d'], 200+x*16, 64+y*16)
|
||||
end
|
||||
end
|
||||
if greyscale then
|
||||
if timer > 1 then timer = 1 end
|
||||
love.graphics.setColor(0.7, 0.7, 0.7, 0+timer)
|
||||
|
||||
@@ -177,7 +177,7 @@ end
|
||||
|
||||
---@param force? boolean Forcing click on hidden widgets?
|
||||
function VCTRL.press(x,y,id,force)
|
||||
if not global_toggle then return end
|
||||
if not (global_toggle and id) then return end
|
||||
local obj,closestDist=false,1e99
|
||||
for _, w in ipairs(VCTRL) do
|
||||
if w.show or force then
|
||||
@@ -196,7 +196,7 @@ function VCTRL.press(x,y,id,force)
|
||||
end
|
||||
|
||||
function VCTRL.release(id)
|
||||
if not global_toggle then return end
|
||||
if not (global_toggle and id) then return end
|
||||
if touches[id] then
|
||||
touches[id]:release()
|
||||
touches[id]=nil
|
||||
|
||||
Reference in New Issue
Block a user