Delta Engine
»
Support
»
UI
»
How to create a main menu
Joined: 12/14/2011(UTC) Posts: 18
Thanks: 6 times
|
I was trying to create a main menu for my test game (not done yet, but I wanted to start with some easy thingy first), but I don't seem to get it right. I took a look at the button / screen toturials, but I'm not sure where to implement it. My first idea was to create an extra MainMenu.cs which is called during the Program.cs execution instead of the Game.cs. Is it necessary / usefull to derive the MainMenu class from the DynamicModule class like the game file itself? Or is it better to implement the main menu directly in the game constructor?
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
It doesn't matter if you derive from DynamicModule or not. The only thing DynamicModule provides is an automatic call to the Run method (wherever you inserted it, the parent in the constructor is important). The question here is why you are not using Delta.Scenes.UserInterfaces? Check out the tests in Delta.Scenes.Tests and you should be able to copy those/extend those into a fully functional main menu UI. You don't have to use those, but they will make your life much easier and all of the games currently being developed use this UI. There is no editor (but some of the teams have written their own) and the advanced controls are not all done yet, but the UI system is very powerful and easily extensible in the Delta Engine
|
 1 user thanked Benjamin for this useful post.
|
|
|
Joined: 12/14/2011(UTC) Posts: 18
Thanks: 6 times
|
I tried them out, but they were all buggy in 0.9.1. Now I installed to latest nightly release (I think 0.9.1.6), and the demos work fine. I hope I can now derive a menu from them. :)
But I'm still not sure where the best place to put the menu code would be. Game constructor? Program.cs? An extra file?
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Yes, sorry about that v0.9.1 had some issues. The v0.9.2 release is comming soon and will have them all fixed (as you can see with the Nightly Releases).
I would just create a new file MainMenu.cs, derive it from BaseScreen and put all the code there. Later you could refactor more and maybe create your own Screen base class for your game, etc. Let us know if you need more tips or samples.
|
 1 user thanked Benjamin for this useful post.
|
|
|
Joined: 12/14/2011(UTC) Posts: 18
Thanks: 6 times
|
Am I doing anything wrong or are the tests even more buggy in v0.9.2?
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Which tests are buggy for you? I have not tested many unit tests this week because they were pretty stable in the nightly releases, but the SampleBrowser was improved and tested more. Maybe you ran into some other trouble?
|
|
|
|
Joined: 12/14/2011(UTC) Posts: 18
Thanks: 6 times
|
All Scenes. (at least those I have tried yet)
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Will test them again, probably had to do with other reported issues on the client side. Server fixes already have been made and projects can be created now again and the Launcher should also now work for everyone.
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
All fixed now in v0.9.2.1. The problem was a new last minute feature, which when initially searching for OptionalAssemblyPath caused WindowsInformation to be invoked and cause the Factory, etc. to be created, which needs OptionalAssemblyPath we want to find in the first place. When an existing Settings.xml was used, or OptionalAssemblyPath was already setup or if the dll is up to date (which is the 3 cases I tested) this does not happen. It did however happen on a fresh installation :(
|
|
|
|
Delta Engine
»
Support
»
UI
»
How to create a main menu
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.