-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoadingScreen.py
71 lines (54 loc) · 1.93 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import pygame
from basicfuncs import *
from config import *
from images import *
pygame.init()
def displayloadingscreen(WIN):
running = True
state = 0
i = 0
cycles = 0
opacity = 0
doneload = 0
textfademultiplier = 1
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
WIN.fill((0,0,0))
if cycles == LOADINGSCREENDELAY:
cycles = 0
state = 1
WIN.blit(loadingscreen,(0,0))
pygame.display.update()
#pygame.time.wait(2000)
loadcheck = 1
if state == 0:
if i == 28*LOADINGSCREENSPEED:
i = 0
cycles += 1
else:
i = i + 1
WIN.blit(lslist[i//30],(0,0))
if state == 1:
if opacity < 200 and not doneload:
opacity += 2.5
else:
doneload = 1
if doneload:
templist = faderepeat(opacity,LOADINGSCREENDONEFADEOUT,200,50,textfademultiplier)
opacity = templist[0]
textfademultiplier = templist[1]
Donefont = pygame.font.Font('resources/fonts/RedHatText-Medium.ttf', 100)
Donefont1 = Donefont.render("DONE", True, (178,161,223))
Donefont1.set_alpha(int(opacity))
startfont = pygame.font.Font('resources/fonts/RedHatText-Medium.ttf',30)
startfont1 = startfont.render("Loading completed. Press any key to proceed.",True, (178,161,223))
WIN.blit(loadingscreen,(0,0))
WIN.blit(Donefont1,(310,220))
WIN.blit(startfont1, (120,360))
for proceedcheck in pygame.event.get():
if proceedcheck.type == pygame.KEYDOWN:
running = False
break
pygame.display.update()