Another very basic demo of a menu and managing various gamestates.
There are better ways to do it (like an int instead of strings) but this is the most verbose and easy to read.
Even if you know how to do this basic little thing, its handy having copy-paste code material on hand...
But what if Red is the rising of the sun, Blue is the sleep still in your eyes, and Green is the path you walk when you're awake ?
I am he as you are he as you are me and we are all together. :)
ok but wtf has this have to do with this, its like saying i love siIvagunna in this conversation
lolwhat
The menu colours aren't really...based on anything :D They're just placeholder functions.
I'm just messing, Kq|1n. And don't mind, AlexClarke, I think he is too. :)
You've made a very solid menu here. Here's a challenge if you are up to it though. Make a multi-layer menu, that is:
WORLD NAME PROPERTIES TILE GLOBAL LOCAL SPRITE COPY SCRIPT |
So, you would initially see 3 menus. Selecting one however brings up another with 2-more items that appear like a folder to the side. Canceling that one step brings you back to the main menu.
:D
Shouldn't be toooooo bad...
Do you mean so that instead of showing a whole new scene, it just expands a tree kind of thing? That might be kinda cool...
Yep, you've got it. In S2 I had one menu go 4-levels deep. Hitting [ESC] it would back out of each one very neatly like one piece of paper folded over another.
Here is an example from Tilemaster.
If you look carefully at the top. The primary menu is at 0,0. The next is just a bit below that so you can still see the other menu in the background; but muted.
Ahh, yeah, okay!
I might actually add those little boxes too and add a calculation to check what the longest string is and make the box the correct size.
I'd like to the make the thing more expandable at some point, once I've done a bit more on my main game.
NP, and yes, you are right. When I wrote Tilemaster I had to determine the maximum length of the text. This gets even trickier when you add special commands to the string like:
^* (enter/exit frame building mode)
^0-9 & A-z (change to alternative font set)
^# (double-size for next character, usually icon)
^[ (left justify following text)
^| (center justify following text)
^] (right justify following text)
You can go a little crazy at it, KQ|1N, but the advantage is you can use this library of yours for many other great programs.
Want to really mix it up ? Use proportional typeface. Since screens are no longer fixed at 1024x768, I am having to use pixel-fonts to handle any screen-size or dimensions.
number ordered table of tree,
tree of menus,
its like a filesystem and a fileexplorer
Alex, is there a site where people post Love2D programs and you can try them out immediately - as PICO does ?
[Please log in to post a comment]