Python Forum
Pygame - Images As Buttons
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pygame - Images As Buttons
#1
Hi,

I've been trying to develop a game w/ Pygame.

One of the items in my game is a "Goodbye" button.
This is a png file.

The Goodbye image will be placed at a certain location.
Let's call it (x1, y1).

How do I make it into a button which will call "quit()"
if the user clicks on the goodbye image/button?

Thanks.
Reply


Messages In This Thread
Pygame - Images As Buttons - by vman44 - Mar-20-2020, 02:16 AM
RE: Pygame - Images As Buttons - by michael1789 - Mar-20-2020, 05:54 AM
RE: Pygame - Images As Buttons - by Windspar - Mar-20-2020, 01:03 PM
RE: Pygame - Images As Buttons - by vman44 - Mar-20-2020, 08:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] pygame-manu : using controller buttons to move around menu mlw19mlw91 2 1,647 Mar-12-2023, 01:55 PM
Last Post: deanhystad
  [PyGame] drawing images onto pygame window djwilson0495 1 3,512 Feb-22-2021, 05:39 PM
Last Post: nilamo
  [pygame] Equiping inventory slots with invisible buttons SheeppOSU 6 4,750 Apr-26-2019, 08:45 PM
Last Post: SheeppOSU
  Problems with loading buttons (pygame) SheeppOSU 2 3,125 Apr-12-2019, 08:04 PM
Last Post: SheeppOSU
  Pygame loads only part of images Prof_Jar_Jar 3 3,103 Dec-22-2018, 03:42 PM
Last Post: Windspar
  Buttons in PyGame mzmingle 4 13,091 Oct-09-2018, 05:19 PM
Last Post: Mekire
  Menus, buttons and other widgets for Pygame Olleus 4 11,500 Apr-17-2017, 11:08 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020