parent
f3ccc88196
commit
5066d84f8d
@ -0,0 +1,18 @@
|
||||
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
|
Loading…
Reference in new issue