Chiblue Posted February 11, 2010 Share Posted February 11, 2010 I know I am being lazy and just trying to avoid re-inventing the wheel, but does anyone have any sample code for building menu options.... I want to build a simple menu and have got a simple menu using 2D graphics but would be interested in seeing other ways of building menus.. Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Mumbles Posted February 12, 2010 Share Posted February 12, 2010 I would have just done it using 2D images all the way - but then I came across a problem. User-defined keys? Would I really have to create an image for every key? I know I could use text, but somehow that just doesn't look as good. At that point I got depressed and just stopped. Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
Niosop Posted February 12, 2010 Share Posted February 12, 2010 Find a nice font... Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Rick Posted February 12, 2010 Share Posted February 12, 2010 What do you mean user-defined keys? If you want to build a truly simple menu like "New Game", "Option", etc. Just use 2D images. Draw them on the screen and note their location and size. Then check the mouse to see if the cursor is within each 2D image. If it is you know what the user selected and can act accordingly. That's basically the idea. Of course you can take that idea and really run with it to make things very advanced like an entire GUI system. Quote Link to comment Share on other sites More sharing options...
Niosop Posted February 12, 2010 Share Posted February 12, 2010 I think she means setting up your movement/action keys. She wants to display the currently assigned key in the menu and have it look super handsome (like me). Maybe take a picture of your keyboard and just cut the keys out? As long as your keyboard is cleaner than mine....or if you're doing a post apocalyptic type game then you could use my keyboard. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Chiblue Posted February 12, 2010 Author Share Posted February 12, 2010 allowing the user to define thier own keys is alway a pain, even through I have a class to support all key options and they are set from a config file, actually building a screen to set a key for each ingame function was a real challenge in GDK... So using 2d images is the norm... just checking so later on I don't get someone say, why would you do it that way are you stupid.... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Rick Posted February 12, 2010 Share Posted February 12, 2010 Am I missing something? When did setting up a menu have anything to do with allowing users to configure keys? That didn't seem to have anything to do with the original post, so that's where I got confused. Original Post I know I am being lazy and just trying to avoid re-inventing the wheel, but does anyone have any sample code for building menu options.... I want to build a simple menu and have got a simple menu using 2D graphics but would be interested in seeing other ways of building menus.. Quote Link to comment Share on other sites More sharing options...
Chiblue Posted February 14, 2010 Author Share Posted February 14, 2010 Right, just got of subject Sorry.. Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
TylerH Posted February 17, 2010 Share Posted February 17, 2010 I used to have a nice set of code and a UI menu for binding keys and/or mouse buttons to different actions, but it was in C#. I will look for it if anyone is interested. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Mumbles Posted February 17, 2010 Share Posted February 17, 2010 Am I missing something? When did setting up a menu have anything to do with allowing users to configure keys? That didn't seem to have anything to do with the original post, so that's where I got confused. Original Post I know I am being lazy and just trying to avoid re-inventing the wheel, but does anyone have any sample code for building menu options.... I want to build a simple menu and have got a simple menu using 2D graphics but would be interested in seeing other ways of building menus.. You can blame me, as is appropriate in many cases. We got on to user-defined keys, because it seemed to me, to be impractical to create so many one (or two) character-pitcure representing assigned keys. If it had been possible to create a large bitmap and reliably subdivide it into many smaller pictures (or someone to demonstrate it, if it is already possible), I would have recommended the 2D graphics idea originally proposed. To my mind, allowing the user to define keys is all part of a menu system, even though this particular feature is not at the root layer, usually it's nested inside "define keys" which is itself nested within "Options" at the root layer. Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
Rick Posted February 17, 2010 Share Posted February 17, 2010 np Mumbles, I was just lost. The topic was asking one thing but as I read the posts it didn't seem like that's what was being answered. Just confused me and I thought I was missing something. Quote Link to comment Share on other sites More sharing options...
Canardia Posted February 17, 2010 Share Posted February 17, 2010 I used to have a nice set of code and a UI menu for binding keys and/or mouse buttons to different actions, but it was in C#. I will look for it if anyone is interested. I was just starting to write a simple Menu system in C++, but if you can convert PGUI2 into C++, then I don't have to write everything from scratch. It has been asked by many people to have somekind of UI system, and LCP1 needs it also. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Chiblue Posted February 17, 2010 Author Share Posted February 17, 2010 I built A similar menu function in DBPro but my concern with le using bitmaps/images for the menus, or even text is that you have to test each button or options x/y to do mouse over and other such techniques what I ended up doing was constructing the menu options In a memory block and then showing then copying the menu to the backplane prior to rendering this worked very well and also had a key bind option.. All settings like the key options got written to a ini type file and this was then read into the game. Also all the menu structures were setup in a sequence of ini files it actually worked very well unfortunately I never converted it to C maybe that would be a good starting point. Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.