diff options
Diffstat (limited to 'rhodes.lua')
-rw-r--r-- | rhodes.lua | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -19,6 +19,16 @@ end function redraw(level) screen.clear(); screen.display_png(dir("rhodes.png"), 0, 0); + + -- draw the jewel light level meter + -- do this here so it won't overdraw the screen + screen.circle(104, 32, 6) + screen.level(math.floor(level or 0)) + screen.fill() + screen.circle(104, 32, 6) + screen.level(15) + screen.stroke() + screen.update() end @@ -124,7 +134,21 @@ function init () end end}) params:default() + redraw() + + -- set a poll to draw the jewel light level meter + p = poll.set("amp_out_l") + p.callback = function (val) + -- log this so it trails off naturally + level = math.log(10 * val + 1) * 15; + -- actually draw it in redraw, so it won't + -- draw over the menu + redraw(level) + end + p.time = 0.025 + p:start() + end function key (n, x) |