PinmikPanik/gamedata/objects/rescalebutton.py

17 lines
494 B
Python
Raw Normal View History

2021-09-19 20:29:24 +02:00
from gamedata.objects.button import Button
class Rescale(Button):
def __init__(self,x,y,game,w,h):
super().__init__(x,y,game,w,h)
self.text = "Reset window scale"
def reset(self,game):
game.screen = game.pygame.display.set_mode((game.DISPLAY_WIDTH,game.DISPLAY_HEIGHT),game.pygame.RESIZABLE)
game.screenw,game.screenh = game.DISPLAY_WIDTH,game.DISPLAY_HEIGHT
game.screenoffx,game.screenoffy = 0,0
self.click = reset