added AV::Sound::pause(), added Lua interface for sounds (play/pause/stop/loop/loopForever)
git-svn-id: svn://anubis/anaglym/trunk@290 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
1 parent
ed1f9c8f7f
commit
d4d44dea86
7 files changed
+150
-17
No files matched your search
+10
-2
@@ -21,6 +21,8 @@ function init_event()
|
||||
ground = ag.loadModel("crate", {static = true, scale = 10})
|
||||
ground:setPosition(0, 0, -10)
|
||||
ag.setCamera(2, -12, 8, 0, 0, 2, 0, 0, 1)
|
||||
|
||||
iris = ag.loadSound("iris.mp3")
|
||||
end
|
||||
|
||||
function key_down_event(key)
|
||||
@@ -38,8 +40,14 @@ function key_down_event(key)
|
||||
ag.registerEventHandler(mouse_moves, "mouse_motion")
|
||||
elseif (key == "n") then
|
||||
ag.clearEventHandler("mouse_motion")
|
||||
elseif (key == "s") then
|
||||
ag.loadSound("iris.mp3")
|
||||
elseif (key == "p") then
|
||||
if (playing) then
|
||||
iris:pause()
|
||||
playing = false
|
||||
else
|
||||
iris:play()
|
||||
playing = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user