forked from ayte/PinmikPanik
19 lines
640 B
Python
19 lines
640 B
Python
|
from gamedata.objects.button import Button
|
||
|
|
||
|
class FullScreen(Button):
|
||
|
|
||
|
def __init__(self,x,y,game,w,h):
|
||
|
|
||
|
super().__init__(x,y,game,w,h)
|
||
|
|
||
|
self.text = "Toggle Fullscreen"
|
||
|
|
||
|
def toggle(self,game):
|
||
|
game.globals["fullscreen"] = not game.globals["fullscreen"]
|
||
|
if game.globals["fullscreen"]:
|
||
|
game.screen = game.pygame.display.set_mode((game.screen.get_width(),game.screen.get_height()),game.pygame.FULLSCREEN)
|
||
|
else:
|
||
|
game.screen = game.pygame.display.set_mode((game.DISPLAY_WIDTH,game.DISPLAY_HEIGHT),game.pygame.RESIZABLE)
|
||
|
|
||
|
self.click = toggle
|