-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoadingScreen.py
41 lines (35 loc) · 1.13 KB
/
LoadingScreen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pygame
pygame.init()
lscreen = pygame.image.load('Images/LoadingScreen.png')
screen = pygame.display.set_mode((800,600))
def blitls(lscreen, screen,txt1):
txtX = 250
txtY = 500
font = pygame.font.Font('PokemonGb-RAeo.ttf', 20)
running = True
i = 255
x = 0
while running:
screen.fill((0,0,0))
screen.blit(lscreen, (0,0))
if i == 255:
while i > 0:
x += 1
font2 = font.render(txt1, True, (255 - x, 255 - x, 255 - x))
screen.blit(font2,(txtX,txtY))
pygame.display.update()
i -= 1
if i <= 0:
break
elif i == 0:
while i < 255:
x -= 1
font2 = font.render(txt1, True, (255 - x, 255 - x, 255 - x))
screen.blit(font2, (txtX, txtY))
pygame.display.update()
i += 1
if i >= 255:
break
for event4 in pygame.event.get():
if event4.type == pygame.KEYDOWN:
running = False