Dynamic Menu Engine

Show us your completed creations made in Construct 2

Post » Fri Apr 25, 2014 5:31 pm

I dislike creating static menus in my projects, so I worked up an engine that reads an XML file, and dynamically creates in-game menus containing components with various functions. So far, I've created components that allow the player to:
  • Open sub-menus
  • Change game settings
  • Re-Map keys
  • Go to a different Layouts
  • Restart the game
  • Go to an external file

The engine is relatively modular, so other types of interfaces can be implemented without much difficulty. The engine could be extended for dialog boxes, shops, and other window-based system.

Here is a demo.

Edit: 4/29: Capx File
Last edited by zatyka on Mon Jan 05, 2015 3:58 am, edited 3 times in total.
B
63
S
19
G
8
Posts: 341
Reputation: 12,130

Post » Fri Apr 25, 2014 5:37 pm

Nice. I usually just manually make my menus for the game this is quite promising.
Freefall Bird
B
47
S
9
G
5
Posts: 280
Reputation: 5,796

Post » Fri Apr 25, 2014 5:40 pm

That's a really nice idea. Would like to see this as a plugin more then a capx file ;)
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Post » Fri Apr 25, 2014 6:06 pm

shinkan wrote:That's a really nice idea. Would like to see this as a plugin more then a capx file ;)


Agreed, but I'm not sure if/how a plug-in of this nature would fit in C2 editor's architecture.
B
63
S
19
G
8
Posts: 341
Reputation: 12,130

Post » Fri Apr 25, 2014 6:45 pm

Probably it wont unfortunately. To take all best bits from that kind of plugin it should have some kind of UI interface to let you choose and set all parameters like size/position/look/functionality of buttons and other controls... like a simple drag and drop editor.

Other idea would be to make external app (should be easily possible to do even in C2) to set all your menus and export them as xml or json. And then plugin could only load that data and setup everything automatically. But still then, plugin should also import and set all graphic assets - very similar to how Spriter loads and sets all from scon files.

but anyway. This kind of "menu plugin" is really great idea!
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Post » Mon Apr 28, 2014 8:57 pm

@shinkan
Agreed, on all points. It would certainly be a handy tool.
B
63
S
19
G
8
Posts: 341
Reputation: 12,130

Post » Mon Apr 28, 2014 9:15 pm

I still believe in this. C2 could really get some better sdk support. We can only wait for modularity i think.

btw. how's the progress on capx file? ;) Did you tried using json instead of xml, for me it's a bit more clearer to write and read json files then xmls.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Post » Tue Apr 29, 2014 1:45 am

@shinkan

Once modularity is implemented, I'm sure an event-based engine like this would become far more useful. I suppose all we can do is wait and see.

The capx just needs to be cleaned up and commented a bit. I got distracted with Ludum Dare, but I'll post it soon. I don't have much experience with json, but if it's simpler, and can function similarly to XML when loading data, I'd be all for it. I'm not particularly a fan of XML either.
B
63
S
19
G
8
Posts: 341
Reputation: 12,130

Post » Tue Apr 29, 2014 2:12 am

This will be a great help as someone who is currently working on menus for my game. I am not familiar with XML but it has to be easier than trying to make one out of events.
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
2
Posts: 113
Reputation: 1,245

Post » Tue Apr 29, 2014 8:57 am

@zatyka not sure how would I describe json so I'll give you two links instead

http://www.jsoneditoronline.org/ - online json editor. There are two windows and by default, one on the left displays "how your text/json file looks like" and one on the right how it is interpreted.

https://www.scirra.com/forum/viewtopic.php?f=183&t=100042 - Here's a wonderful plugin made by @Yann for json files. You don't need to use this plugin in C2 (it's already supporting json data) but it's a great tool to create, modify and manage data structures

and here's a little comparison

XML
Code: Select all
<product>
     <id>15</id>
     <name>Widgets</name>
     <description>These widgets are the finest widgets ever made by anyone.</description>
     <options type="color">
          <item>Purple</item>
          <item>Green</item>
          <item>Orange</item>
     </options>
</product>


and json
Code: Select all
"product" : {
     "id" : 15,
     "name" : "Widgets",
     "description" : "These widgets are the finest widgets ever made by anyone.",
     "options" : [
          {
               "type" : "color",
               "items" : [
                    "Purple",
                    "Green",
                    "Orange"
               ]
          }
       ]
}


I will not say it's better but for me personally is much easier to read, write and manipulate.
And obviously you can add, remove, loop and do all kind of manipulations at runtime.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Next

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 2 guests