Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RoTTer

Pop up menus

This topic is 6909 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello Im trying to allow the player in my "game" to right-click the screen and get a menu popped up (just like the regular menus that pops up when you right click stuff -like the desktop, MS Word, Netscape-) and I want to, of course, put any button (or entry) in the menu and be able to read which entry was selected and process it. Is it hard to do? Can someone help me on this? =] Thanks a lot! Cya, -RoTTer

Share this post


Link to post
Share on other sites
Advertisement
If you''re using the windows message queue, you want WM_RBUTTONDOWN. If you''re using DirectInput, you want to test the high bit of rgbButtons[1].

Share this post


Link to post
Share on other sites
Hey!
Thanks for the answer :>

Uhm, Im using Windows'' MSGs. But how can I actually make theat menu pop up, and then read what option the guy selected?

Cya, and thanks again,
-RoTTer

Share this post


Link to post
Share on other sites
If you want a right-click popup menu you will need to use a resource script to design your menu, assign each button an ID etc... The whole process is a bit large to explain here, but if you have the DXSDK quite a few of the samples use those kinds of menu (e.g. the DInput Scrawl sample). You can look at the source code and see how it is done.

-- Jon Hobson --

Share this post


Link to post
Share on other sites
Ah!
Thanks a lot for the hint. I do have the DX SDK here (and am using DX to do the "game", but as it is windowed and is not really a game, I thought it would be easier to use that kind of menu that Windows "supports" and I dont have to make my own), Ill check that sample you pointed out!

Thanks again, and cya,
-RoTTer

Share this post


Link to post
Share on other sites
Hey

Does anyone have a specific example (sample code) on that subject? Or could write a small example code here?
Cause I was really lost on that DX example as Im not really a Windows expert (not even 1/100 of it heeh) programmer...
I found the part that adds the 3 custom buttons on the pop-up menu, but I couldnt find the code that initializes/assigns the right buttom to pop that up =/.

Thanks a lot, cya,
-RoTTer

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!