change mixpoint visual
This commit is contained in:
parent
64850adae2
commit
ed5f93104d
|
@ -3,6 +3,8 @@ local self = {}
|
||||||
local quality = 256
|
local quality = 256
|
||||||
local graph = {}
|
local graph = {}
|
||||||
|
|
||||||
|
self.touchtimer = 0
|
||||||
|
|
||||||
function self.update(dt)
|
function self.update(dt)
|
||||||
for i = 1, quality do
|
for i = 1, quality do
|
||||||
local a = (i - 1) / (quality - 1)
|
local a = (i - 1) / (quality - 1)
|
||||||
|
@ -18,6 +20,7 @@ function self.update(dt)
|
||||||
end
|
end
|
||||||
graph[i] = mix(v, b, math.min(dt * 18, 1))
|
graph[i] = mix(v, b, math.min(dt * 18, 1))
|
||||||
end
|
end
|
||||||
|
self.touchtimer = mix(self.touchtimer, 0, dt * 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
function self.render()
|
function self.render()
|
||||||
|
@ -43,8 +46,8 @@ function self.render()
|
||||||
|
|
||||||
-- mixease point
|
-- mixease point
|
||||||
if mode == 2 then
|
if mode == 2 then
|
||||||
love.graphics.setColor(1, 1, 1, 0.8)
|
love.graphics.setColor(1, 1, 1, 0.2 + self.touchtimer * 0.6)
|
||||||
love.graphics.line(x + margin + mixpoint * w, y, x + margin + mixpoint * w, y + h)
|
love.graphics.line(x + margin + oldmixpoint * w, y, x + margin + oldmixpoint * w, y + h)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- preview point
|
-- preview point
|
||||||
|
|
1
main.lua
1
main.lua
|
@ -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
|
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
|
mixpoint = (mx - x) / w
|
||||||
|
graph.touchtimer = 1
|
||||||
dropdown.createDropdowns()
|
dropdown.createDropdowns()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue