add pulse ease icon & line width

This commit is contained in:
jill 2021-09-18 13:21:53 +03:00
parent 0cf2ec445a
commit df3bfb150a
4 changed files with 11 additions and 5 deletions

View file

@ -8,6 +8,7 @@ local icon = {
unknownease = love.graphics.newImage('unknownease-icon.png'), unknownease = love.graphics.newImage('unknownease-icon.png'),
linearease = love.graphics.newImage('linearease-icon.png'), linearease = love.graphics.newImage('linearease-icon.png'),
instantease = love.graphics.newImage('instantease-icon.png'), instantease = love.graphics.newImage('instantease-icon.png'),
pulseease = love.graphics.newImage('pulseease-icon.png'),
} }
local dropdowns = {} local dropdowns = {}
@ -178,6 +179,7 @@ function self.render()
love.graphics.rectangle('line', x, y, w, h) love.graphics.rectangle('line', x, y, w, h)
love.graphics.print(self.selected(i), x + margin/2, y + margin/2) love.graphics.print(self.selected(i), x + margin/2, y + margin/2)
-- love.graphics.rectangle('line', x + w - h, y, h, h) -- love.graphics.rectangle('line', x + w - h, y, h, h)
love.graphics.setLineWidth(1)
love.graphics.polygon('line', x + w - h/2 + 0.3 * h, y + h/2 - 0.3 * h, x + w - h/2 - 0.3 * h, y + h/2 - 0.3 * h, x + w - h/2, y + h/2 + 0.3 * h) love.graphics.polygon('line', x + w - h/2 + 0.3 * h, y + h/2 - 0.3 * h, x + w - h/2 - 0.3 * h, y + h/2 - 0.3 * h, x + w - h/2, y + h/2 + 0.3 * h)
if self.openDropdown == i or v.open > 0.01 then if self.openDropdown == i or v.open > 0.01 then
@ -229,6 +231,7 @@ function self.render()
love.graphics.rectangle('fill', x + w - size, y + h + scroll * (1 - displayed) * (maxDropdown - 1) * h * v.open, size, displayed * (maxDropdown - 1) * h * v.open) love.graphics.rectangle('fill', x + w - size, y + h + scroll * (1 - displayed) * (maxDropdown - 1) * h * v.open, size, displayed * (maxDropdown - 1) * h * v.open)
end end
end end
love.graphics.setLineWidth(lineWidth)
end end
end end

View file

@ -27,24 +27,24 @@ table.insert(self, {'tri', function(t) return 1 - abs(2 * t - 1) end, type = 'tr
table.insert(self, {'bell', function(t) return self.inOutQuint(self.tri(t)) end, type = 'transient'}) table.insert(self, {'bell', function(t) return self.inOutQuint(self.tri(t)) end, type = 'transient'})
table.insert(self, {'pop', function(t) return 3.5 * (1 - t) * (1 - t) * sqrt(t) end, type = 'transient'}) table.insert(self, {'pop', function(t) return 3.5 * (1 - t) * (1 - t) * sqrt(t) end, type = 'transient'})
table.insert(self, {'tap', function(t) return 3.5 * t * t * sqrt(1 - t) end, type = 'transient'}) table.insert(self, {'tap', function(t) return 3.5 * t * t * sqrt(1 - t) end, type = 'transient'})
table.insert(self, {'pulse', function(t) return t < .5 and self.tap(t * 2) or -self.pop(t * 2 - 1) end, type = 'transient'}) table.insert(self, {'pulse', function(t) return t < .5 and self.tap(t * 2) or -self.pop(t * 2 - 1) end, type = 'pulse'})
table.insert(self, {'spike', function(t) return exp(-10 * abs(2 * t - 1)) end, type = 'transient'}) table.insert(self, {'spike', function(t) return exp(-10 * abs(2 * t - 1)) end, type = 'transient'})
table.insert(self, {'inverse', function(t) return t * t * (1 - t) * (1 - t) / (0.5 - t) end, type = 'transient'}) table.insert(self, {'inverse', function(t) return t * t * (1 - t) * (1 - t) / (0.5 - t) end, type = 'pulse'})
table.insert(self, {'popElastic', function(t, damp, count) table.insert(self, {'popElastic', function(t, damp, count)
return (1000 ^ -(t ^ damp) - 0.001) * sin(count * pi * t) return (1000 ^ -(t ^ damp) - 0.001) * sin(count * pi * t)
end, {1, 10, 1.4, 'damp'}, {1, 25, 6, 'count'}, type = 'transient'}) end, {1, 10, 1.4, 'damp'}, {1, 25, 6, 'count'}, type = 'pulse'})
table.insert(self, {'tapElastic', function(t, damp, count) table.insert(self, {'tapElastic', function(t, damp, count)
return (1000 ^ -((1 - t) ^ damp) - 0.001) * sin(count * pi * (1 - t)) return (1000 ^ -((1 - t) ^ damp) - 0.001) * sin(count * pi * (1 - t))
end, {1, 10, 1.4, 'damp'}, {1, 25, 6, 'count'}, type = 'transient'}) end, {1, 10, 1.4, 'damp'}, {1, 25, 6, 'count'}, type = 'pulse'})
table.insert(self, {'pulseElastic', function(t, damp, count) table.insert(self, {'pulseElastic', function(t, damp, count)
if t < .5 then if t < .5 then
return self.tapElastic(t * 2, damp, count) return self.tapElastic(t * 2, damp, count)
else else
return -self.popElastic(t * 2 - 1, damp, count) return -self.popElastic(t * 2 - 1, damp, count)
end end
end, {1, 10, 1.4, 'damp'}, {1, 25, 6, 'count'}, type = 'transient'}) end, {1, 10, 1.4, 'damp'}, {1, 25, 6, 'count'}, type = 'pulse'})
table.insert(self, {'impulse', function(t, damp) table.insert(self, {'impulse', function(t, damp)
t = t ^ damp t = t ^ damp

View file

@ -25,6 +25,7 @@ padding = 16
outerpadding = 22 outerpadding = 22
margin = 6 margin = 6
dropdownWidth = 128 dropdownWidth = 128
lineWidth = 2
fontHeight = love.graphics.getFont():getHeight() fontHeight = love.graphics.getFont():getHeight()
-- global for convinience's sake -- global for convinience's sake
@ -47,6 +48,8 @@ function love.draw()
local sw, sh = love.graphics.getDimensions() local sw, sh = love.graphics.getDimensions()
local mx, my = love.mouse.getPosition() local mx, my = love.mouse.getPosition()
love.graphics.setLineWidth(2)
love.graphics.setColor(0.09, 0.09, 0.12, 1) love.graphics.setColor(0.09, 0.09, 0.12, 1)
love.graphics.rectangle('fill', 0, 0, sw, sh) love.graphics.rectangle('fill', 0, 0, sw, sh)
love.graphics.setColor(0.08, 0.08, 0.1, 1) love.graphics.setColor(0.08, 0.08, 0.1, 1)

BIN
pulseease-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B