Page 1 of 1

How to make a menu

Posted: October 30th, 2018, 9:07 am
by New Nova
Yup !
I need some help ! I need to know how to make a menu.
Something basic, with a choice (like 1 player/2player), but I don't know how to make a cursor for highlighting the choice.
Can someone help me out ? :)

Re: How to make a menu

Posted: October 30th, 2018, 9:57 pm
by gwald
New Nova wrote: October 30th, 2018, 9:07 am Yup !
I need some help ! I need to know how to make a menu.
Something basic, with a choice (like 1 player/2player), but I don't know how to make a cursor for highlighting the choice.
Can someone help me out ? :)
Sounds easy to do, a good exercise for a beginner.
Get text rendering on screen first, then get controllers working, then put boxes around it (I used GsSortBoxFill), and put it all together!
Also, best to use your own font, this is the one I used:
Image


And you'll get something like my craptasctic menu at 0:20: :lol:
[BBvideo=560,315] https://www.youtube.com/watch?v=E5XPaKG ... tu.be&t=21 [/BBvideo]

Re: How to make a menu

Posted: October 31st, 2018, 1:09 am
by New Nova
Thanks ! :)
you're helpful !

Re: How to make a menu

Posted: October 31st, 2018, 7:59 am
by gwald
no problem, there's easier ways to do a menu actually.
Just generate the list in an image and displaying it would be easier then using a font (but font's are need in games! :) )
Then just move something (another image or a coloured RECT etc) on screen.
But the basics are rendering and moving something, but it depends on your context.
If you youtube some games you'll see many ideas for menus, some good, some really poor.

Re: How to make a menu

Posted: October 31st, 2018, 8:50 am
by New Nova
Thanks.
I think it would be helpful for others.
I'm learning slowly, because I don't understand everything about the system. It's the first time that I make a game with pictures, sprites etc..
Also, what did you think about the code of my "pong" ? :)

Re: How to make a menu

Posted: November 1st, 2018, 8:20 am
by gwald
Looks good, simple yet functional.
I would look at moving the functions from the headers though, maybe into a constants.c (building it with -c, getting the .o (or .obj), then linking it to the exe), leaving the declaration prototypes.
or keep it as is and define them as inline?
ie: https://stackoverflow.com/questions/942 ... -or-static

maybe do a screen cap video if you can?

Re: How to make a menu

Posted: November 1st, 2018, 9:10 am
by New Nova
I don't understand. What is an .o ? XD
I'm a little noob at C programming XD

Re: How to make a menu

Posted: November 1st, 2018, 2:47 pm
by gwald
-c on gcc (unix/linux/etc compiler) give you not an exacutable but a binary 'object' windows uses .obj instead of .o (unix/linux).
Look at makefiles, you'll see -c producing .o (.obj) files then the last command links main, libraries and the obj's to create a executable.

You should read up on the toolchain, ie pre compiler compiler, linker, library, make etc.
It's all pretty standard, on many hardware platforms and OS'es and its applicable to C++.
It's something that has a learning curve, but it's worth knowing very well!

I'm not sure on the pro PSX compiler, but i'm sure it's based on gnu gcc toolchain.