diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-28 23:34:19 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-28 23:34:19 +0200 |
commit | 27c7e16e4bd808ce1176f18b7a78c02ff4fa88ee (patch) | |
tree | a585d5ef853a0f8ffd5000cbdc9b0c4257163e53 /src/sliceitoff/images/images.py | |
parent | f894c2fd09ed17540c49cb4083573861ded76554 (diff) |
fonts under text, more sprite.Groups
Diffstat (limited to 'src/sliceitoff/images/images.py')
-rw-r--r-- | src/sliceitoff/images/images.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/sliceitoff/images/images.py b/src/sliceitoff/images/images.py deleted file mode 100644 index 7ae1f6d..0000000 --- a/src/sliceitoff/images/images.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -import pygame - -from display import Scaling - -DEBUG = os.getenv("DEBUG") - -class Images: - surfaces = {} - - @staticmethod - def reload_images(base_path): - __class__.surfaces = {} - filename_imagelist = os.path.join(base_path, "assets", "images.lst") - with open( filename_imagelist ) as imagelist_file: - for line in imagelist_file: - name, *path = line.strip().split() - filename = os.path.join(base_path, *path) - if DEBUG: - print(f"Loading images {name = }, {filename = }") - image = pygame.image.load(filename) - rgba = pygame.Surface.convert_alpha(image) - scaled = pygame.transform.smoothscale_by(rgba, Scaling.factor*10) - __class__.surfaces[name] = scaled - return True - - @staticmethod - def load_images(base_path): - if __class__.surfaces: - return False - return __class__.reload_images(base_path) -
\ No newline at end of file |