Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Help me with my menu  (Read 4162 times)

0 Members and 1 Guest are viewing this topic.

wanted123

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Help me with my menu
« on: March 03, 2011, 11:39:12 AM »

Hello All! I'm new to this forum so i want to make a game i'm maybe 10% done with my game. i want to know how to make my menu to show up when i'm starting the game. My meni will have new game, load game extras, quit. In which script i need to write and what i need to write to make my meni show up after i started the game. My english is not very good! ;D
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Help me with my menu
« Reply #1 on: March 03, 2011, 12:06:59 PM »

Create a new scene in ProjectMan, name it "menu" or something. This scene will load a window representing the menu. To do that, edit this scene's scene_init.script and insert something like this:

Code: WME Script
  1. var mainMenu = Game.LoadWindow("path\mainmenu.window");
  2. mainMenu.GoExclusive();
  3.  

Now you need to create the menu window itself. Again, you can add a new window in ProjectMan and edit it using WindowEdit.

And finally tell your game to load the menu scene first. In ProjectMan there's a "Startup scene" option for that.

Be sure to check the "WME Demo 3D". It does exactly what you want, so you can find inspiration and more details there.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

wanted123

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Re: Help me with my menu
« Reply #2 on: March 03, 2011, 02:23:17 PM »

thanks all working perfectly but now when i click esc in the mainmenu is showing the other ingame menu. i want to have two menus one for new game, quit, extras, loadgame(that's ok). but the other ingame menu with savegame and quit is showing if you press esc in the main menu.
Sorry for my BAD ENGLISH
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Help me with my menu
« Reply #3 on: March 03, 2011, 06:12:25 PM »

For this type of menu, instead of:

Code: WME Script
  1. mainMenu.GoExclusive();

try

Code: WME Script
  1. mainMenu.GoSystemExclusive();
Logged

wanted123

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Re: Help me with my menu
« Reply #4 on: March 03, 2011, 09:25:16 PM »

New problem now in the main menu when i click esc menu closes this is the mainmenu need to stay like in other games so when i click esc my game need to ask if i want to quit. so how i can change in the main menu when i click esc to ask if i want to quit. not just to close the mainmenu i hope you'll understand me
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Help me with my menu
« Reply #5 on: March 03, 2011, 09:34:09 PM »

Look inside your main menu script for the on "Keypress" event. You should see something like this:

Code: WME Script
  1. on "Keypress"
  2. {
  3.   // on Esc key
  4.   if(Keyboard.KeyCode==VK_ESCAPE)
  5.    {
  6.  

There you can define what happens when the player presses the escape key (VK_ESCAPE)
Logged
 

Page created in 0.04 seconds with 25 queries.