A GUI library for building retro-snes style RPG menus

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

A GUI library for building retro-snes style RPG menus

Post by pauljessup »

Hey all, this is a library I built for an RPG I'm working on in Love2d, based on the old SNES style RPG's (Chrono Trigger, FF4&6, Secret of Mana, etc) which had some of the best RPG's ever made.

Anyway, I realized that the library was pretty versatile, so I thought I would push out to see if anyone else would have use for it. It's a very niche library, with a very limited purpose, but it can do it pretty darn well. It's pretty simple to set up...it uses TLBind to take in the input.

Here's the library:
https://dl.dropboxusercontent.com/u/635941/snes_gui.zip

To install, just put the folder (snes_gui) in the same directory as your main.lua file, and then require('snes_gui') and it will grab the rest.

Here's an example:
https://dl.dropboxusercontent.com/u/635 ... xample.zip

Here's a love file of the example:
https://dl.dropboxusercontent.com/u/635 ... ample.love


Here's a basic example of how to use it:

Everything is run through the gui_stack. To update, all you need to do is call gui_stack.update() in the love update function. To draw, just call gui_stack.draw() in the love draw function. To initialize it, you need to set up the colors you want to use for the background and the color that outlines the GUI's widgets/objects.

Basically like so:
-- This is the background color/alpha for the GUI
local gui_background={r=121, g=118, b=107, alpha=200}
-- This is the Outlin color/alpha for the GUI
local gui_outline={r=255, g=255, b=255, alpha=255}

--Pass the above definitions to the GUI_STACK.
--the font included here is a font designed to
--look like the one from Secret of Mana, called Manaspace
gui_stack.set_defaults("manaspc.ttf", 12, gui_background, gui_outline)


And here's a basic example of adding a message box that appears...kind of a "hello world":
--This creates the notification and adds it to the gui_stack.
gui_stack.add("notice", notice_box( 10, 2, 220, 65, gui_trans.fade, "Hello world"))

Once you initialize it, the update and draw handle the rest. With the menu system, it uses a simple way to add functions to each of the menu selections so that when the user selects and item, hits accept, it calls the script. You don't have to do anything, just set it up which functions to call and it does it all itself.
User avatar
Dissident
Prole
Posts: 5
Joined: Mon Jul 01, 2013 6:12 pm

Re: A GUI library for building retro-snes style RPG menus

Post by Dissident »

I just tried the demo. At first I thought I could move Terra around; I was dissapointed when I couldn't. Oh well.

One thing that really bothers me about this is the fact that it's animated. Have you ever tried to navigate menus very quickly, but found that you were stuck or selected the wrong option because an animation was playing when you pressed the button and it didn't get your input? It's especially bad if the game is already upsetting you. I have been hoping for a long time that menu animations could be abolished.

Personally, I never understood the compulsion to make retro-style games, so perhaps the animations are more important to the effect than I realize. It's just something I wouldn't do/use myself.
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: A GUI library for building retro-snes style RPG menus

Post by pauljessup »

Yeah, the animations aren't just part of retro-console gaming, but really, a part of console gaming itself. Even just a fading in/out animation...

Personally, I like games with animated menus, they just feel a bit more professional. BTW, the menu animations aren't necassary- if anyone where to use this, and didn't want the menus to be animated, there is a way to set the transitions to gui_style.none that should just skip them.

Moving Terra around:
This is just an example of the menus and how to build your own game menus. It's more for people to look at the source and then use the code in their own game (if they want). It wasn't meant to be a playable game, just an example of how-to-do-it yourself.

Some notes:
I've updated the source and fixed some bugs when it came to knowing which menus had focus. Now it works properly, so that if you call a menu within a menu within a menu within a menu within a menu, it knows which one to use. And then when you close out of that one, it cascades backwards properly. This is necessary for things like item menus, choosing which player to use an item on, etc.

I'm also going to eventually turn this into a GitHub repository. Just not yet...soon though.

Features to come (later):
Multi column menus (for item screens, etc)
multi-page/scrolling menus (also for item screens, etc)
Icon based menus (attaching images to certain parts of the menu, including the menu select, next to each menu item name, etc)
Icon message box/notification box
Gradient menus with alpha
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: A GUI library for building retro-snes style RPG menus

Post by jjmafiae »

hmm good job
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: A GUI library for building retro-snes style RPG menus

Post by pauljessup »

Thanks! I recently updated it, giving it a better algorithm for creating the snes style boxes, and slightly faster animation times. It also fixed a few bugs that were coming up. Also added some blinking text to the menu, just for fun. I might remove that later, or make it optional or something.

I plan on, in about a month, do another huge release. Making the text in the message boxes more robust, more customization, and some other stuff.
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: A GUI library for building retro-snes style RPG menus

Post by jjmafiae »

pauljessup wrote:Thanks! I recently updated it, giving it a better algorithm for creating the snes style boxes, and slightly faster animation times. It also fixed a few bugs that were coming up. Also added some blinking text to the menu, just for fun. I might remove that later, or make it optional or something.

I plan on, in about a month, do another huge release. Making the text in the message boxes more robust, more customization, and some other stuff.
sounds great i might consider using it or making something similar :D
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: A GUI library for building retro-snes style RPG menus

Post by pauljessup »

Cool :) and if you want to make your own, the more the merrier I say!

It might be a bit before my next update/release...working on a map engine and sprite factory
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: A GUI library for building retro-snes style RPG menus

Post by jjmafiae »

pauljessup wrote:Cool :) and if you want to make your own, the more the merrier I say!

It might be a bit before my next update/release...working on a map engine and sprite factory
i will call it RadNonRPGMenusLibrary Library
Post Reply

Who is online

Users browsing this forum: No registered users and 221 guests