Möan.lua - A simple messagebox system.
Posted: Mon Jul 03, 2017 11:16 am
I noticed there wasn't anything recent around that does this kind of thing - so I made one!
Simply;
Features:
- Multiple choice option selector
- Typing effects + UTF8 text support
- HUMP+flux camera integration
- Message box icons + title colours
- Typing skips
- Simple theming
A full example,
The choices will be displayed on the last message in the message array.
Icons for the message box must be 380x380px - I've yet to sort out some kind of auto-scaling for this...
Anyway, here's the full documentation: https://github.com/twentytwoo/Moan.lua
Let me know what you think! Please tell me about any bugs + features you think should be added
Updates:
- noImage image is now options, for text only messageboxes
- Added defMsgContainer(), an alternate way to store messages (for use with metatables for e.g.)
- Added Moan.keypressed + bug fixes, updated .love
- Added history of all messages, Moan.history.
- Added quick text pre-wrap algo
- Added option for colored title text
- Removed arbitrary 3 option limit, now "infinite"
- UI update, variable typing speeds, made HUMP camera integration optional, update .love
- Fixed recursion crashing, fixed UTF8 support
- Added sound effect on keys typed
- Added pauses, for ~dramatic effect~
- Changed syntax yet again
- Simplified function calling, updated .love
- Added demo .love
- Re-write, version 0.2.0 - now has multiple choice, execute functions on choice, choose specific icons and a better font, cleaner code base
- Cleaned up the Global namespace, a lot.
- Added UTF-8 support, thanks @FuffySifilis
- Added Moan.advanceMsg() so you can have programmable control over changing messages
Simply;
Code: Select all
Moan.speak("Title", {"Hello world!", "It's me;--Möan.lua"})
- Multiple choice option selector
- Typing effects + UTF8 text support
- HUMP+flux camera integration
- Message box icons + title colours
- Typing skips
- Simple theming
A full example,
Code: Select all
avatar = love.graphics.newImage("image.png")
Moan.speak({"Red snake", {255,0,0}}, {"Message one", "two--and", "three..."}, {x=10, y=10, image=avatar,
onstart=function() something() end, oncomplete=function() something() end,
options={
{"Option one", function() option1() end},
{"Option two", function() option2() end},
{"Option three",function() option3() end}}
})
Icons for the message box must be 380x380px - I've yet to sort out some kind of auto-scaling for this...
Anyway, here's the full documentation: https://github.com/twentytwoo/Moan.lua
Let me know what you think! Please tell me about any bugs + features you think should be added
Updates:
- noImage image is now options, for text only messageboxes
- Added defMsgContainer(), an alternate way to store messages (for use with metatables for e.g.)
- Added Moan.keypressed + bug fixes, updated .love
- Added history of all messages, Moan.history.
- Added quick text pre-wrap algo
- Added option for colored title text
- Removed arbitrary 3 option limit, now "infinite"
- UI update, variable typing speeds, made HUMP camera integration optional, update .love
- Fixed recursion crashing, fixed UTF8 support
- Added sound effect on keys typed
- Added pauses, for ~dramatic effect~
- Changed syntax yet again
- Simplified function calling, updated .love
- Added demo .love
- Re-write, version 0.2.0 - now has multiple choice, execute functions on choice, choose specific icons and a better font, cleaner code base
- Cleaned up the Global namespace, a lot.
- Added UTF-8 support, thanks @FuffySifilis
- Added Moan.advanceMsg() so you can have programmable control over changing messages