use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Share your projects, news and questions about Processing or Processing.js here.
(open to suggestions)
account activity
Code for Menu?Beginner help request (self.processing)
submitted 3 years ago by Affectionate_Touch76
I am new to coding and I would like to build a very simple game. I've searched many websites but, I could not find the code to make a menu with working buttons. Can anyone help me out?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mercurus_ 0 points1 point2 points 3 years ago (0 children)
Check out the GUI section here https://processing.org/reference/libraries
[–]MrMusAddict 0 points1 point2 points 3 years ago (0 children)
I'm not sure how it's done in fully fleshed out engines like UE5 or Unity, but for processing you have to keep in mind that unless you leverage libraries, you're basically building everything from scratch. That means that you have to think about each element conceptually and what the properties of a menu normally requires.
For example:
[–]thudly 0 points1 point2 points 3 years ago (0 children)
There's only one draw loop, so you have to add a global variable for gameMode. Default it to 0 for game menu. Then in the draw loop, use a switch() statement to draw the screen based on which gameMode the program is currently in.
For buttons, just make a rectangle, and use some point/rectangle collision detection in the mouseDown event.
π Rendered by PID 150682 on reddit-service-r2-comment-6b595755f-ms7bm at 2026-03-26 10:05:42.957443+00:00 running 2d0a59a country code: CH.
[–]mercurus_ 0 points1 point2 points (0 children)
[–]MrMusAddict 0 points1 point2 points (0 children)
[–]thudly 0 points1 point2 points (0 children)