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 »

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 »

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: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

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

Post by drunken_thor »

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
Talkies for all dialog needs
Github
twitter
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

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

Post by pgimeno »

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.
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

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

Post by drunken_thor »

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
Talkies for all dialog needs
Github
twitter
User avatar
4vZEROv
Party member
Posts: 126
Joined: Wed Jan 02, 2019 8:44 pm

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

Post by 4vZEROv »

Nice rework :)
I found some things you could work :
- playSound() and parseSpeed() are global
- indentation timer is framerate dependant
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

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

Post by drunken_thor »

@4vZEROv Thanks I just added an update with those changes
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
LesbianHam
Prole
Posts: 5
Joined: Thu Nov 21, 2019 12:07 am

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

Post by LesbianHam »

drunken_thor wrote: 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.
There doesn't seem to be any sort of license as far as I can see. Can this be used commercially, and even if you're okay with that, would it then depend on how the OP feels about it, considering Talkies is based on, and pretty much is an updated version of Moan? I'd really like to avoid finding myself in any sort of legal trouble in the future. Thanks!
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post by zorg »

LesbianHam wrote: Mon Nov 25, 2019 7:17 am There doesn't seem to be any sort of license as far as I can see. Can this be used commercially, and even if you're okay with that, would it then depend on how the OP feels about it, considering Talkies is based on, and pretty much is an updated version of Moan? I'd really like to avoid finding myself in any sort of legal trouble in the future. Thanks!
Both the original and the rewrite is licensed under the MIT license; the former has a LICENSE file, the latter mentions it at the top of the talkies.lua file.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
nequals30
Prole
Posts: 9
Joined: Sun Sep 22, 2019 5:54 pm

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

Post by nequals30 »

In möan/talkies, is there a way to resize my font if I am using an imageFont?
Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests