Total Complexity | 4 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import pygame |
||
2 | |||
3 | |||
4 | def load(path, alpha=True): |
||
5 | return pygame.image.load(path).convert_alpha() \ |
||
6 | if alpha else pygame.image.load(path).convert() |
||
7 | |||
8 | |||
9 | def get_text(text, font, c, pos, centered=False): |
||
10 | text = font.render(text, True, c, None) |
||
11 | text_rect = text.get_rect() |
||
12 | if centered: |
||
13 | text_rect.center = pos |
||
14 | else: |
||
15 | text_rect.x, text_rect.y = pos |
||
16 | return text, text_rect |
||
17 |