Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Bringing up the menu with right click  (Read 2274 times)

0 Members and 1 Guest are viewing this topic.

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Bringing up the menu with right click
« on: April 20, 2007, 07:06:47 PM »

I've tried to modify game.script in the WME Demo to make a simple right click on an "inactive" area bring up the main menu. I know that this should be simple, but for some reason, I haven't succeed.

Thanks for any help!

Mikael
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Bringing up the menu with right click
« Reply #1 on: April 20, 2007, 08:50:31 PM »

In game.script there's the RightClick handler (on "RightClick" ...). You'll need to add something like this to the beginning of the handler:

Code: [Select]
on "RightClick"
{
  if(Game.ActiveObject==null)
  {
    // no active object under mouse pointer; load and display some window
    var Menu = Game.LoadWindow("path\menu.window");
    Menu.GoSystemExclusive();
    Game.UnloadObject(Menu);
    return;   
  }
 
  // some more right-click handling here...
}
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Re: Bringing up the menu with right click
« Reply #2 on: April 21, 2007, 01:08:56 AM »

Thanks!

Mikael
Logged
 

Page created in 0.063 seconds with 23 queries.