Questions tagged [pygame-menu]

Pygame-menu is a python-pygame library for creating menus. It supports several widgets, such as buttons, color inputs, clock objects, drop selectors, frames, images, labels, selectors, tables, text inputs, color switches, and many more, with many options to customize.

Resources:

16 questions
1
vote
2 answers

ModuleNotFoundError: No module named 'pygame_menu'

I'm trying to make a game using pygame and pygame_menu. When I try to install pygame_menu I get this error: Traceback (most recent call last): File "D:\Game\main.py", line 7, in import pygame_menu ModuleNotFoundError: No module named…
ProGamer2711
  • 451
  • 1
  • 5
  • 18
1
vote
2 answers

Pygame Images won't load in after being called

I've been trying to make Space Invaders using PyGame in Python and make a list for the enemy images, and I make a for loop twice to load the images in and append them to the lists; 2 times for 2 rows. Though, the only pictures that appear are the…
edwardvth
  • 41
  • 3
1
vote
0 answers

How would I add a background image and sound to this pygame program?

Hello I would need help I would need to place a background image and some sound. possibly also sound effects after clicking on the button, I have taken over the menu, because I didn't know how to do it, I wanted to do it via the buttons, but somehow…
Krocan
  • 9
  • 2
1
vote
1 answer

I'n creating my first game in pygame and i need help on showing up a screen when i press any key

As i mention, i'm super new in pygame and need help with this. I'm just testing the pygame commands, and want to show up a white screen with a message whenever i initialize the game and press any key, but apparently, it's not working. Here's my…
ronny
  • 41
  • 7
1
vote
0 answers

Button using pygame_menu.events.CLOSE nonfunctional

Though a button calling pygame_menu.events.EXIT works to close the whole Pygame program, one calling pygame_menu.events.CLOSE does not seem to do anything. (Edit: I also tried the menu close() method, but with the same result.) I would like it to…
Lyndon Gingerich
  • 604
  • 7
  • 17
0
votes
0 answers

Pygame and Pygame_menu gives Attribute error even though the library exists

I have a code like the following: import pygame import pygame_menu pygame.init() screen = pygame.display.set_mode((1000, 1000), pygame.RESIZABLE) screen.fill((255, 255, 255)) menu = pygame_menu.Menu( height=400, width=600, …
chen
  • 167
  • 9
0
votes
1 answer

How to add picture in pygame menu?

I am working on a simple game on Python using module pygame. I made a menu, where user can choose a character for the game. When the program is running, the names of the characters are displayed one by one, so user can choose a character for the…
Hey
  • 1
0
votes
0 answers

Why is the menu not going to next page Python/pygame/pygame-menu

The issue is with GameMode Value as it isn't being picked up my def Start_the_GameV2 and just need help to allow the code to continue through the pages ```import pygame, pygame_menu GameMode = "ShotMaking" def Starting_Menu(): …
Jbag_
  • 1
0
votes
1 answer

pygame-menu not working with posted events

I want to use pygame-menu on a raspberry pi with rotary encoders. When I post up/down events from the encoder callback to pygame, it does not seem compatible. The menu does not react. The same code can post non-keyup/down events successfully. For…
barbazoo
  • 977
  • 5
  • 11
0
votes
2 answers

How to get the value from the text_input field in a pygame-menu?

I'm trying to apply pygame-menu library (https://pygame-menu.readthedocs.io). How can I extract the 'Name' value from the text-input field of the menu - the value that this field contains when I start the game i.e. strictly at the moment when I…
0
votes
1 answer

How to link those two pygame-menus

I have created two menus using Pygame-menu. The first one is the start menu (when you open the program). import pygame import pygame_menu from pygame import mixer pygame.init() #Mida i nom de la finestra surface = pygame.display.set_mode((600,…
Torchllama
  • 43
  • 1
  • 7
0
votes
1 answer

Create a variable from the menu.add.text.input from Pygame (Menu)

Where it says user_input = menu.add.text_input('User: ') or age_input = menu.add.text_input('Age: '), you can write something. I need to assign the words that are written to a variable. How could I do it? import pygame import pygame_menu import…
Torchllama
  • 43
  • 1
  • 7
0
votes
0 answers

Improving Pygame_menu

I started learning pygame a couple of days ago, and I would like to make this code better. import pygame import pygame_menu pygame.init() surface = pygame.display.set_mode((600, 400)) font = pygame_menu.font.FONT_8BIT menu =…
Torchllama
  • 43
  • 1
  • 7
0
votes
1 answer

Pygame-menu dice rolling GUI. Stuck on displaying returned integer values on screen?

I recently wrote a command line program for random dice rolls for the various types of D&D dice, and I want to turn it into a basic GUI next. I've got the below image worked out using Pygame-Menu library, and I also have functions which return a…
jacket562
  • 1
  • 1
0
votes
0 answers

Pygame - Button to change whats on current screen to another

This is for my programming project and I'm having difficulties trying to make my code do what I want it to do (Probably because i have never used pygame or any GUI tool). Basically for my project i wanted to make a program called "Logic Gate…
1
2