aboutsummaryrefslogtreecommitdiff
path: root/viewer.lua
diff options
context:
space:
mode:
Diffstat (limited to 'viewer.lua')
-rw-r--r--viewer.lua50
1 files changed, 49 insertions, 1 deletions
diff --git a/viewer.lua b/viewer.lua
index fd3e116..506c406 100644
--- a/viewer.lua
+++ b/viewer.lua
@@ -13,18 +13,66 @@ function drawMusic()
drawControls(8+38,win[9].h-34-8)
drawDownBox(10+38+38+38,win[9].h-34+5,118,5,2)
drawUpBox(mplay.volx,mplay.voly,10,25,2)
+ love.graphics.setColor(0,256,0)
+ love.graphics.setFont(pixeloperators)
+ love.graphics.print(mplay.title, 10,82)
+ if mplay.p == true then
+ for i=1,10 do
+ if mplay.bar[i] == nil then
+ mplay.bar[i] = {}
+ mplay.bar[i].h = 20
+ mplay.bar[i].ht = 20
+ else
+ if mplay.bar[i].h > mplay.bar[i].ht then
+ mplay.bar[i].h = mplay.bar[i].h - 1
+ elseif mplay.bar[i].h < mplay.bar[i].ht then
+ mplay.bar[i].h = mplay.bar[i].h + 1
+ elseif mplay.bar[i].h == mplay.bar[i].ht then
+ mplay.bar[i].ht = math.random(0,40)
+ end
+ love.graphics.rectangle("fill",(23*i)-13,33,21,mplay.bar[i].h)
+ end
+ end
+ end
+ love.graphics.setFont(pressstart)
end
function drawControls(x,y)
love.graphics.setColor(256,256,256)
drawUpBox(x,y,32,32,2)
- love.graphics.draw(but.play, x, y)
+ love.graphics.draw(but.but, x, y)
drawUpBox(x+38,y,32,32,2)
love.graphics.draw(but.stop, x+38, y)
drawUpBox(x-38,y,32,32,2)
love.graphics.draw(but.back, x-38, y)
end
function updateMusic()
+ if mouseClick(win[9].x+8+38,win[9].y+win[9].h-34-8,32,32) == true and mplay.m ~= 0 and mplay.pr == false then
+ if but.but == but.pause then
+ mplay.m:pause()
+ mplay.p = false
+ but.but = but.play
+ win[9].update = true
+ elseif but.but == but.play then
+ mplay.p = true
+ but.but = but.pause
+ win[9].update = true
+ end
+ mplay.pr = true
+ elseif mouseClick(win[9].x+8+38-38,win[9].y+win[9].h-34-8,32,32) == true and mplay.m ~= 0 and mplay.pr == false then
+ mplay.m:rewind()
+ mplay.p = true
+ but.but = but.pause
+ win[9].update = true
+ mplay.pr = true
+ elseif mouseClick(win[9].x+8+38+38,win[9].y+win[9].h-34-8,32,32) == true and mplay.m ~= 0 and mplay.pr == false then
+ mplay.m:stop()
+ mplay.p = false
+ but.but = but.play
+ win[9].update = true
+ mplay.pr = true
+ end
if mplay.p == true and mplay.m ~= 0 then
+ win[9].update = true
mplay.m:play()
end
if win[9].ex == true and mplay.m ~= 0 then