diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-15 17:44:52 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-15 17:44:52 +0200 |
commit | 5d921239e0577988e2b7814025149d9160ecbdda (patch) | |
tree | da21e540734499879a8d9c47da826e5227d44881 | |
parent | 4bd0381cef63e59801ec05786ec17d567bc4245c (diff) |
full screen, please
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | src/sliceitoff/display/__init__.py | 1 | ||||
-rw-r--r-- | src/sliceitoff/display/display.py | 17 | ||||
-rw-r--r-- | src/sliceitoff/main.py | 15 |
4 files changed, 36 insertions, 0 deletions
@@ -1,3 +1,6 @@ +# Caches +__pycache__ + # Editor backups *~ diff --git a/src/sliceitoff/display/__init__.py b/src/sliceitoff/display/__init__.py new file mode 100644 index 0000000..6332319 --- /dev/null +++ b/src/sliceitoff/display/__init__.py @@ -0,0 +1 @@ +from .display import Display diff --git a/src/sliceitoff/display/display.py b/src/sliceitoff/display/display.py new file mode 100644 index 0000000..151bb11 --- /dev/null +++ b/src/sliceitoff/display/display.py @@ -0,0 +1,17 @@ +import pygame + +class Display(): + def __init__(self): + pygame.display.init() + mode_info = pygame.display.Info() + self.screen = pygame.display.set_mode( + (mode_info.current_w, mode_info.current_h), + pygame.FULLSCREEN ) + + def update(self, groups = None): + """ Updates the screen: clear, blit gropus and flip """ + self.screen.fill() + pygame.display.flip() + + def __del__(self): + pygame.display.quit() diff --git a/src/sliceitoff/main.py b/src/sliceitoff/main.py new file mode 100644 index 0000000..5f1f3ce --- /dev/null +++ b/src/sliceitoff/main.py @@ -0,0 +1,15 @@ +from pygame import ( + init as pg_init, + quit as pg_quit) + +from time import sleep + +from display import Display + +def main(): + pg_init() + d = Display() + sleep(4) + pg_quit() + +main()
\ No newline at end of file |