title: Can't find a way to get one of my pictures to stay on screen when my mouse click is pressed
body: <p>I'm trying to get an image to stay on screen when my left click is pressed. I've been mostly following the Sentdex videos on youtube for info on how to draw the buttons etc, so if its a bit messy, its because i'm pretty new to pygame! The aim of this game is to be a First Person Shooter, but recently found out that's virtually impossible with python :( So im just carrying on with this project to see where else it could go. Any ideas/suggestions would be much appreciated!</p>
  
  <pre><code>import time
  import pygame
  from tkinter import *
  #import pyautogui
  
  pygame.mixer.pre_init(44100,16,2,4096)
  pygame.init()
  
  display_width = 1200
  display_height = 600
  
  black = (0,0,0)
  white = (255,255,255)
  red = (255,0,0)
  green = (0,255,0)
  
  hgrey = (77,197,179)
  hlight_grey = (255,102,106)
  grey = (68,187,169)
  light_grey = (247,94,98)
  
  pygame.mixer.music.load('music/privia_the_begining.mp3')
  pygame.mixer.music.play(-1)
  
  counter = 0
  
  gameDisplay = pygame.display.set_mode((display_width,display_height))
  pygame.display.set_caption('Privia 1.0')
  clock = pygame.time.Clock()
  
  gameIcon = pygame.image.load('pics/priviaicon.png')
  bannerIcon = pygame.image.load('pics/priviabanner.png')
  backgroundMenu = pygame.image.load('pics/bgm.png')
  backgroundGameType = pygame.image.load('pics/bgmws.png')
  
  pygame.display.set_icon(gameIcon)
  
  def text_objects(text, font):
    textSurface = font.render(text, True, black)
    return textSurface, textSurface.get_rect()
  
  def messeage_display(text):
    largeText = pygame.font.Font('freesansbold.ttf',115)
    TextSurf, TextRect = text_objects(text, largeText)
    TextRect.center = ((display_width/2),(display_height/2))
    gameDisplay.blit(TextSurf, TextRect)
  
    pygame.display.update()
  
  def button(msg,x,y,w,h,ic,ac,action=None):
      mouse = pygame.mouse.get_pos()
      click = pygame.mouse.get_pressed()
  
      if x+w &gt; mouse[0] &gt; x and y + h &gt; mouse[1] &gt; y:
          pygame.draw.rect(gameDisplay, ac,(x,y,w,h))
          if click[0] == 1 and action != None:
              action()         
      else:
          pygame.draw.rect(gameDisplay, ic,(x,y,w,h))
  
      smallText = pygame.font.Font("freesansbold.ttf",20)
      textSurf, textRect = text_objects(msg, smallText)
      textRect.center = ( (x+(w/2)), (y+(h/2)) )
      gameDisplay.blit(textSurf, textRect)
  
  def quitgame():
      pygame.quit()
      quit()
      pygame.mixer.stop()
  
  def main_menu():
    intro = True
  
    while intro:
      for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            quit()
  
      gameDisplay.blit(backgroundMenu, [0, 0])
  
      gameDisplay.blit(bannerIcon,(300,4))
  
      button("SinglePlayer",430,260,350,100,grey,hgrey,game_type)
      button("Quit",507,400,200,50,light_grey,hlight_grey,quitgame)
  
      pygame.display.update()
      clock.tick(15)
  
  def game_type():
    gameDisplay.blit(backgroundGameType, [0, 0])
    print("working")
  
  main_menu()
  </code></pre>