Moan.update updates the library (which you forgot to add)
Moan.draw is used to draw the messages in the message queue
Hopefully this works (in LOVE 0.10.x) - untested btw.
Code: Select all
require("lovesplash/lovesplash")
local Moan = require("Moan")
state = "lovesplash"
function love.load()
-- Insert a message into the message queue
-- Message shown when Moan.draw called (in menu state)
Moan.speak("Title", {"Hello world!", "It's me;--Möan.lua"})
end
function love.draw()
if state == "lovesplash" then
lovesplash.draw()
else if state == "menu" then
Moan.draw()
end
end
function love.update(dt)
if state == "lovesplash" then
lovesplash.update(dt)
if lovesplash.done() then
state = "menu"
Moan.update(dt)
end
end
end
function love.keypressed()
if state == "lovesplash" then
lovesplash.stop()
else if state == "exit" then
love.event.quit()
else
end
end
end
function love.mousepressed()
if state == "lovesplash" then
lovesplash.stop()
else if state == "exit" then
love.event.quit()
else
end
end
end
I apologise in advance for how awkward the library is to use - I wrote it last year when my programming skills were pretty bad, I'm planning a rewrite in the near future for LOVE 11.