Total Complexity | 2 |
Total Lines | 10 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import pygame |
||
2 | |||
3 | TEXTURES_PATH: str = "assets/textures" |
||
4 | |||
5 | |||
6 | def load_texture(file: str, alpha: bool = True) -> pygame.Surface: |
||
7 | """Loads a asset from a file and convert it into a pygame.Surface.""" |
||
8 | surface = pygame.image.load(f'{TEXTURES_PATH}/{file}') |
||
9 | return surface.convert_alpha() if alpha else surface.convert() |
||
10 |