About 95,500 results
Open links in new tab
  1. How to make buttons in python/pygame? - Stack Overflow

    Apr 16, 2012 · if event.type == pygame.MOUSEBUTTONDOWN and event.button == 1: mouse = pygame.mouse.get_pos if Image[1].collidepoint(mouse): #code if button is pressed goes here …

  2. python - Creating rect Buttons with Pygame - Stack Overflow

    Oct 31, 2016 · import pygame import sys def main(): pygame.init() clock = pygame.time.Clock() fps = 60 size = [200, 200] bg = [255, 255, 255] screen = pygame.display.set_mode(size) …

  3. Pygame, best way to implement buttons? - Stack Overflow

    Mar 29, 2019 · We need something to represent a button: a button has a text, and an action that is invoked when we click it. Since something happens when a button is clicked, we need to …

  4. How can I add an image or icon to a button rectangle in Pygame?

    In pygame a button is nothing more than a pygame.Surface object. It is completely irrelevant whether a text or an image is on the button. I recommend to represent the buttons by …

  5. Object oriented circular button in pygame? - Stack Overflow

    Sep 12, 2019 · I want to make a circular button in pygame. I had made a class for the rectangle button. (below) But I want to make it as a circle (and also other polygon). I know there is no …

  6. python - Closing Pygame Window - Stack Overflow

    Nov 10, 2013 · pygame.init() initializes all pygame modules (display, mixer, font, etc.) and pygame.quit() does the contrary, closes all modules. one can initalize a module per turn, if you …

  7. PyGame, How do I create a button with text? - Stack Overflow

    I am trying to create a button in pygame with text inside it. I have scowered the internet and stack overflow but there doesnt seem to be a solution for my problem. button = …

  8. How to create a pause button in Pygame? - Stack Overflow

    Jun 10, 2015 · I've been trying to make a game, and everything in there works so far except that the pause button , that when pressed the button P should pause and when pressed S should …

  9. How do you create buttons using pygame? - Stack Overflow

    Jan 14, 2014 · In this case, you end up using an existing pygame-compatible GUI library. Google for "pygame gui library" and start playing around with them. These libraries have already …

  10. How to make a toggle type button in pygame? - Stack Overflow

    Sep 23, 2018 · Rects are used in a more object-oriented method where the button is a child class of the Pygame.sprite.Sprite class. Then you can assign a rect object as its self.image.rect …

Refresh