change mixpoint visual

This commit is contained in:
jill 2021-09-18 02:15:31 +03:00
parent 64850adae2
commit ed5f93104d
2 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,8 @@ local self = {}
local quality = 256
local graph = {}
self.touchtimer = 0
function self.update(dt)
for i = 1, quality do
local a = (i - 1) / (quality - 1)
@ -18,6 +20,7 @@ function self.update(dt)
end
graph[i] = mix(v, b, math.min(dt * 18, 1))
end
self.touchtimer = mix(self.touchtimer, 0, dt * 2)
end
function self.render()
@ -43,8 +46,8 @@ function self.render()
-- mixease point
if mode == 2 then
love.graphics.setColor(1, 1, 1, 0.8)
love.graphics.line(x + margin + mixpoint * w, y, x + margin + mixpoint * w, y + h)
love.graphics.setColor(1, 1, 1, 0.2 + self.touchtimer * 0.6)
love.graphics.line(x + margin + oldmixpoint * w, y, x + margin + oldmixpoint * w, y + h)
end
-- preview point

View File

@ -94,6 +94,7 @@ function love.draw()
if mx > x and mx < x + w and my > y and my < y + h and love.mouse.isDown(1) and dropdown.openDropdown == 0 then
mixpoint = (mx - x) / w
graph.touchtimer = 1
dropdown.createDropdowns()
end
end