Creating menus using Codeblocks (C++)

Started by
6 comments, last by Isvar Arthur 8 years, 8 months ago

Hi I'm learning in C++. I am currently making a game and would like to know how to make menus several of them. I would like to make a Start game, Highscore and an Exit Menu. Please Help

Advertisement
#1: Design the menu layout. On paper if necessary.
#2: Create the assets. Borders, backgrounds, text, characters, icons, etc.
#3: Code the game to show these assets in the manner you desire.

If you have more questions you will need to be specific.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Also, each Menus can be a state inside the engine you are using, making a simple interface with Update, Draw and Clear or what ever fit your need. Consider using one state per menu, unless your design do not need it.

Just plug the current state inside the main game loop and change it when you need it.

We'll be happy to answers more question.

How would I be able to create a basic menu window that I'll be able to put some text on. Am trying to be more specific.

Thanks

Am trying to be more specific.

Then you’re going to have to be more specific.
  • What kind of menu?
    • An operating system menu like the ones above every window?
      • Then what operating system are you using?
    • A graphical menu like in every standard game?
      • Then what API are you using? OpenGL or Direct3D?
        • Direct3D 9? Direct3D 11?
  • What have you tried?
    • Why did it fail to live up to your expectations?
  • What have you researched on your own?
    • Why aren’t your research results suitable for you?
When you post a question you need to follow certain guidelines if you want to get the best response.
  • If your question or task has multiple parts or stages, take it one step and one post per step at a time.
  • For each post, explain clearly what you want to do, what you have tried, why it didn’t work, and any relevant information such as your operating system, graphics API, bank-account information, credit-card information, skill level/experience, overall goal, etc.
L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

I may be wrong, but I'm guessing from the title of the thread that you want to know how to use Code::Blocks to create system menus.

If this is the case, the answer is that you can't1 If you want a visual tool for creating menus (and if you're targeting Windows), then Visual Studio is a better choice of IDE for you as it has a WYSIWYG editor for GUI elements, unlike Code::Blocks, which is purely a code editor.

[1] You can of course by writing code for creating the menus, but that can be done with any IDe/editor, and isn't something intrinsic to Code::Blocks.

If you do indeed mean system menus (the os gui) then there is something called wxwidgets which is crossplatform. WXcrafter is a RAD tool for wxwidgets. Wxcrafter is built in to a IDE called CodeLite. There is also something called wxsmith for codeblocks. I have no experience with either so I can't really help beyond that.

If you don't mean that there are a few options for ingame gui's none of which are coming to mind right now. If I remember or have time to look it up I'll post them later. Oh there is this: http://anttweakbar.sourceforge.net/doc/ for you to look into.

-potential energy is easily made kinetic-

Hello everybody!,I didn't want to create an additional topic because I think I'm in a similar situation as the original poster :

Feeling the need to move to Code::Blocks (from TurboC++) I realized to not have a very direct way of constructing GUI controls (in a similar manner to Visual Basic) so, in a way, it seems to be a 16 bits compiler (O.K. not strictly a compiler but the downloaded package included GNU GCC).

And my confussion only grew as I was discovering my new environment. I have read carefully the topic and in particular the hints given by LennyLen and Infinisearch and these are my -wrong?- conclusions :

my GCC equipped Code::Blocks 13.12 will be able to make GUI forms depending on the selected compiler; and the pressence of "Win32 GUI Project" and "wxWidgets project" on templates selection responds to possibility of future installations of corresponding compilers (in this case, any 32 bit capable complier). I.e. wxWidgets is integrated through wxsmith but I can only practice, not create.

Of course, everything I said are my cautious hypothesis so please I admit any notice that I'm making mistakes, thanks.

On top of that, we got the alternative of FLTK, and its GUI builder Fluid, so I wonder if that's a more than viable option (compatibility issues maybe?).

Many thanks in advance!.

This topic is closed to new replies.

Advertisement