Here is my code:
if mgc == 0 and event.type == MOUSEBUTTONDOWN and pygame.mouse.get_pos() >= (250, 15) and pygame.mouse.get_pos() <= (363, 51):
ofnt_thing = input("What font would you like your score to be in? ")
if ofnt_thing == "":
file = open("fontdefault.txt", "r+")
default = file.read()
print("Set to default: " + default)
ofnt_thing = default
file.close()
elif ofnt_thing == "set_default()":
newfile = open("fontdefault.txt", "w+")
newdef = input("New default font: ")
newfile.write(newdef)
ofnt_thing = newdef
newfile.close()
ofnt = pygame.font.SysFont(str(ofnt_thing), 50)
stxt = ofnt.render(str(score), False, (255, 20, 255))
if mgc == 0 and event.type == MOUSEBUTTONDOWN and pygame.mouse.get_pos() >= (250, 65) and pygame.mouse.get_pos() <= (437, 100):
if lag == True: lag = False
else: lag = True
So, when I run this part of my program, it is supposed to ask for a change in font if the mouse's x-value is between 250 and 363 and the y-value between 15 and 51. This works just fine. However, for the lag toggle button, it asks for a font change when I click in the middle or to the left of the button. Why is this happening?