How to make a menu

General Programming help in C, C++ or ASM, Compiling / Debugging, and R3000A Central Processing Unit (CPU) information
Post Reply
User avatar
New Nova
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: October 27th, 2018, 8:48 am
I am a: Student in IT, Artist
Motto: Try and retry.
PlayStation Model: SCPH-1001
Want to Find: Tutorials
Looking to: Share some tests
Location: France

How to make a menu

Post by New Nova » 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 ? :)
MY PONG IS NOT READY

User avatar
gwald
1997 Yaroze Enthusiast
1997 Yaroze Enthusiast
Posts: 256
Joined: September 18th, 2013, 8:44 am
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Location: Australia
Contact:

Re: How to make a menu

Post by gwald » October 30th, 2018, 9:57 pm

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:
https://www.youtube.com/watch?v=E5XPaKGQbII&feature=youtu.be&t=21

User avatar
New Nova
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: October 27th, 2018, 8:48 am
I am a: Student in IT, Artist
Motto: Try and retry.
PlayStation Model: SCPH-1001
Want to Find: Tutorials
Looking to: Share some tests
Location: France

Re: How to make a menu

Post by New Nova » October 31st, 2018, 1:09 am

Thanks ! :)
you're helpful !
MY PONG IS NOT READY

User avatar
gwald
1997 Yaroze Enthusiast
1997 Yaroze Enthusiast
Posts: 256
Joined: September 18th, 2013, 8:44 am
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Location: Australia
Contact:

Re: How to make a menu

Post by gwald » October 31st, 2018, 7:59 am

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.

User avatar
New Nova
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: October 27th, 2018, 8:48 am
I am a: Student in IT, Artist
Motto: Try and retry.
PlayStation Model: SCPH-1001
Want to Find: Tutorials
Looking to: Share some tests
Location: France

Re: How to make a menu

Post by New Nova » October 31st, 2018, 8:50 am

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" ? :)
MY PONG IS NOT READY

User avatar
gwald
1997 Yaroze Enthusiast
1997 Yaroze Enthusiast
Posts: 256
Joined: September 18th, 2013, 8:44 am
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Location: Australia
Contact:

Re: How to make a menu

Post by gwald » November 1st, 2018, 8:20 am

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?

User avatar
New Nova
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: October 27th, 2018, 8:48 am
I am a: Student in IT, Artist
Motto: Try and retry.
PlayStation Model: SCPH-1001
Want to Find: Tutorials
Looking to: Share some tests
Location: France

Re: How to make a menu

Post by New Nova » November 1st, 2018, 9:10 am

I don't understand. What is an .o ? XD
I'm a little noob at C programming XD
MY PONG IS NOT READY

User avatar
gwald
1997 Yaroze Enthusiast
1997 Yaroze Enthusiast
Posts: 256
Joined: September 18th, 2013, 8:44 am
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Location: Australia
Contact:

Re: How to make a menu

Post by gwald » November 1st, 2018, 2:47 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest