Möan.lua - A simple messagebox system.

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
milk
Prole
Posts: 39
Joined: Sun Jul 17, 2016 7:20 pm

Re: Möan.lua - A simple messagebox system.

Post by milk » Sat Jun 30, 2018 3:52 pm

Moan.speak is used to insert a single message into the message queue, and therefore should only be called once per message - by putting Moan.speak into love.draw you are inserting new message every frame (which would probably cause the game to crash eventually)
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
Also I'd recommend reading the example main.lua (https://github.com/ttxi/Moan.lua/blob/master/main.lua) as it shows how to use the library and is pretty heavily commented.
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.

Snaker1
Prole
Posts: 9
Joined: Wed Dec 19, 2018 7:43 pm

Re: Möan.lua - A simple messagebox system.

Post by Snaker1 » Thu Dec 27, 2018 8:04 pm

Just bumping to say that I really like this lib.

It is a great and lightweight way of adding message boxes to a game that looks great and does not mess with the rest of the game code. Absolutely priceless!

I recently used it for a game in Love 11.2 without any problems and with only a few tweaks, so it still a viable option.

Is there a reason why it was removed on github? Is it still worked on?

User avatar
drunken_thor
Citizen
Posts: 74
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: Möan.lua - A simple messagebox system.

Post by drunken_thor » Sun Jan 06, 2019 2:06 am

Hey everyone, I went looking for this library today and found that the repo and the user's github account has been deleted so I created and mirrors the code from the original .love file in this thread https://github.com/tanema/Moan.lua. If anyone has a more recent version of it with bug fixes please either let me know or open a PR.
Light_world.lua for all your lighting needs
Github
twitter

User avatar
pgimeno
Party member
Posts: 1531
Joined: Sun Oct 18, 2015 2:58 pm

Re: Möan.lua - A simple messagebox system.

Post by pgimeno » Sun Jan 06, 2019 12:25 pm

There's a fork here: https://github.com/stephenwithav/Moan.lua

Maybe you can reconstruct part of the history based on that.

I hate when people do that. It shows little respect for their followers. Unfortunately this is not among the libraries that I was keeping a mirror of because I didn't think I'd ever need it.
Thrust II Reloaded - GifLoad for Löve - GSpöt GUI - My NotABug.org repositories - portland (mobile orientation)
The MS-Github repositories I had have been closed after the acquisition announcement and will be removed in the near future.

User avatar
drunken_thor
Citizen
Posts: 74
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: Möan.lua - A simple messagebox system.

Post by drunken_thor » Sat Feb 02, 2019 5:42 am

For anyone interested in this still, I have done a rewrite of this project with a bit more design and a bit more sillyness with the name: https://github.com/tanema/talkies

Some Changes
- eliminated all global leaking variables!
- A bit more maintainable
- less magic numbers and calculations in drawing the dialog box
- easier theming
- talking and typing sound systems so that you can multiple types of sounds.
- abstracted the key functionality out of the library so that you can manage it yourself.
- updated defaults for 11+
- added onMessage function
- Took out camera functionality because you can do the same with onstart, oncomplete functions and you shouldn't be tied to other peoples libraries.
- ability to have dialogs without images.
- better project layout so that you don't need to require a whole folder, instead just require a single file.
Light_world.lua for all your lighting needs
Github
twitter

User avatar
4vZEROv
Prole
Posts: 15
Joined: Wed Jan 02, 2019 8:44 pm

Re: Möan.lua - A simple messagebox system.

Post by 4vZEROv » Sun Feb 03, 2019 1:59 pm

Nice rework :)
I found some things you could work :
- playSound() and parseSpeed() are global
- indentation timer is framerate dependant

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests