How to Create a Menu in Pygame

How to Create a Menu in Pygame

Coding With Russ

2 года назад

109,278 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Camilo Verner
Camilo Verner - 19.09.2023 05:17

Video muito esclarecedor! Obrigado amiigo!

Ответить
Hilox
Hilox - 01.09.2023 16:14

bro thank you

Ответить
Guts Joestar
Guts Joestar - 07.08.2023 19:14

im here because when i tried this, my menu don't adjust to fullscreen, the rest is just blank white, i hope its explained in the video

Ответить
nick566
nick566 - 03.08.2023 16:58

how did you get that bar on the side of your screen on the python i have got its just a window with no menu bar at top all it says is the path i run it from

Ответить
Charles Mendoza
Charles Mendoza - 01.08.2023 23:53

nice tutorial i implement this paused menu to the tower defence game

Ответить
MrLOL
MrLOL - 31.07.2023 21:46

Hi, I been trying to do this menu, but I got a black screen for some reason

Ответить
Proxy
Proxy - 26.07.2023 07:24

Where is the code of Button Class??????😡😡😡

Ответить
Legend Gamer
Legend Gamer - 02.07.2023 20:22

You Are A Fox

Ответить
Bisi Atilade
Bisi Atilade - 05.04.2023 21:53

If you alrready have a game for the code written, where would you add this code ? Thank u

Ответить
yzhk
yzhk - 27.03.2023 06:45

Great video!

Ответить
D H
D H - 14.03.2023 22:46

self.image.get_rect()

Ответить
Alphamaine
Alphamaine - 03.02.2023 03:12

where did you get the images from??

Ответить
Jakub Sláma
Jakub Sláma - 17.01.2023 16:41

For anyone having a problem such as buttons on the same coordinates in submenus gets automatically clicked, make a variable: clicked = False and set it to True whenever a button is clicked and make buttons clickable only if clicked is False. Set clicked back to False after the pygame.MOUSEBUTTONUP is triggered. For example:
if button.draw(screen) and not clicked: # if button.draw(screen) and clicked == False:
do_something()
clicked = True
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONUP:
clicked = False

Ответить
Daviddedank
Daviddedank - 14.01.2023 13:54

the font.render just gives me an error saying "'str' object has no attribute 'render'"

Ответить
Tristan Dombroski
Tristan Dombroski - 13.01.2023 04:45

Wait... So I don't even really need Tkinter for buttons? the first thing I noticed was no import for Tkinter. Wish I could find the tutorial I watched a few days ago and point the guy in this direction... I like the way you do buttons.

Ответить
Usman Amjad
Usman Amjad - 10.01.2023 19:49

thanks

Ответить
derar5555
derar5555 - 27.12.2022 14:50

Hi there. Thanks a lot
I'm having trouble creating various menus with Pygame using your method, since some of the menu buttons, although on different menu screens, share the same coordinates. So once one gets pressed, the next screen detects the button still being pressed and automatically triggers as well.

Ответить
Saitama
Saitama - 25.12.2022 14:07

Awesome video. I have a little problem where my submenu buttons are in the exact same place as the menu button. When I click a menu button, the program goes through and also clicks the submenu button. Is there a way I can delay the click or something? I noticed that in this video, your buttons are not in the same place so that problem may have not come up.

Edit: I added a "clicked" check and it worked.

Ответить
So Soo
So Soo - 06.12.2022 11:12

Hi Coding Russ, have been watching most of your tutorials. Right now I am trying to create a function to pause the game inside Pygame. Do you have a video on it or is there any way you can guide me on it? Much appreciated for all your help.

Ответить
Dans Assis
Dans Assis - 23.11.2022 20:04

Thank you very much for this tutorial, I was having a lot of trouble with this part. Clean and straight to the point.

Ответить
soop
soop - 12.11.2022 11:33

I dont get the ability to close the window even after putting in the exact same code as yourself. My window just stays locked open :/

Ответить
danu zota
danu zota - 01.10.2022 23:10

thanks for the good video!👍

Ответить
Valeant Igot
Valeant Igot - 11.09.2022 11:29

Hey, I enjoy watching your videos! Are you in audea btw..

Ответить
modnaya shalava
modnaya shalava - 02.09.2022 00:55

Man you're so damn good at explanation for real and only having 13k it's very undervalued :(

Ответить
Ray
Ray - 29.08.2022 22:26

keep getting an error "unident doesnt match with any other indentation level"

Ответить
Tuffo
Tuffo - 27.08.2022 08:00

What happened to your website?
When I tried to access it, it says "Account suspended" even though I haven't done anything.

Ответить
Rat Madness
Rat Madness - 09.08.2022 20:05

Thanks!!!

Ответить
Justin 7oo9
Justin 7oo9 - 26.07.2022 12:37

Very nice tutorial I'm kinda new I followed some of your game tutorials and they are amazing I learnt so much and I also had a question what os do you use (i know its windows but just asking )

Ответить
Dqew
Dqew - 01.07.2022 00:24

when i press back it quits the application are u able to help please

Ответить
ToujoursIris
ToujoursIris - 30.06.2022 01:26

New video?

Ответить
Panda Zorrao
Panda Zorrao - 24.06.2022 02:01

Bro your channel is a hidden gem, awesome content

Ответить
HelloWtf
HelloWtf - 18.06.2022 23:01

Can you do a tutorial for a game who connect to tiktok live comments,donations,followers,likes and the game react to all descbribe,thank you !

Ответить
Dubpper
Dubpper - 15.06.2022 11:04

very nice men! thanks a lot

Ответить
hazem hazem
hazem hazem - 09.06.2022 17:54

thank you ,,,,that's Great but I want to ask about (platformer game) ?

Ответить
NDNGR
NDNGR - 06.06.2022 08:56

Sir can you make tutorial how to add punch block and break block in python pygame

Ответить
NDNGR
NDNGR - 06.06.2022 08:55

Sir can you make tutorial how to create 2d minecraft in python pygame

Ответить
tari gaming
tari gaming - 28.05.2022 14:10

thanks for the explanation all of them really really helps me thanks for making this vedeos

Ответить
Plexus
Plexus - 27.05.2022 05:56

Great this is what i need because i'm working on a game with the knowledge that i've gotten from you. Although I am having trouble trying to figure out how to make them work like if i click the video setting you can actually customize the settings.

Ответить
Mahmud Shuaib
Mahmud Shuaib - 26.05.2022 13:31

awesome. just so you know, i smashed the like button and bell! if there are any other button to smash, tell me!

Ответить
Atharv Kumar
Atharv Kumar - 26.05.2022 11:01

That's awesome

Ответить
Day playlist
Day playlist - 25.05.2022 21:51

Круто😌👍

Ответить
Kobalt
Kobalt - 25.05.2022 20:48

Love your videos man, keep it up

Ответить
CodeRunner
CodeRunner - 25.05.2022 20:46

I really enjoyed your all video nice explanation sir
Please teach us how to create a 3d game using pygame

Ответить
Sol Girassol
Sol Girassol - 25.05.2022 20:12

Thanks so much for this video.
I can put a image on the background of the options menu? Or just fill with colors?

Ответить
Mr. Tech Guy
Mr. Tech Guy - 25.05.2022 19:57

Oh...
Real nice...
✅✅✅✅

Ответить
Max Studio CG
Max Studio CG - 25.05.2022 19:50

very usefull but im still at 3/13 on that game :))))))))))))))))))

Ответить
ToujoursIris
ToujoursIris - 25.05.2022 19:49

The thing I was waiting for!

Ответить