This commit is contained in:
Paul Liverman III
2018-04-06 15:30:00 -07:00
parent f0a9da387a
commit a45aa2624e
101 changed files with 12392 additions and 77 deletions

21
LIB/types/spinner.moon Normal file
View File

@@ -0,0 +1,21 @@
path = (...)\sub 1, -("spinner"\len! + 2)
generic = require "#{path}/generic"
import graphics from love
import pi, min from math
tau = pi * 2
half_pi = pi / 2
class spinner extends generic
new: (element={}, parent) =>
super element, parent
-- @offset = -half_pi
@offset = 0 unless @offset
@value = 0.1 -- temporary
-- slab = require "#{path\sub 1, -7}/slab"
draw: =>
-- TODO should be setting color!
graphics.arc "line", @x + @w / 2, @y + @h / 2, min(@w, @h), @offset, @offset + @value * tau