Jump to content

Menus in LE


Chiblue
 Share

Recommended Posts

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..

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

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.

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

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.... ;)

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

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.

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

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.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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.

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...