-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
62 lines (32 loc) · 1.02 KB
/
main.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
# import pygame module in this program
import pygame
from os import environ
from sys import platform as _sys_platform
def platform():
if 'ANDROID_ARGUMENT' in environ:
return "android"
elif _sys_platform in ('linux', 'linux2','linux3'):
return "linux"
elif _sys_platform in ('win32', 'cygwin'):
return 'win'
pygame.init()
white = (255, 255, 255)
X =720
Y = 1080
display_surface = pygame.display.set_mode((X, Y ),pygame.FULLSCREEN)
# set the pygame window name
pygame.display.set_caption('Pygame To Apk')
if platform()=="android":
path="/data/data/org.test.pgame/files/app/"
elif platform()=="linux":
path="./"
image = pygame.image.load(path+"image.png")
# infinite loop
while True :
display_surface.fill(white)
display_surface.blit(image, (0, 0))
for event in pygame.event.get() :
if event.type == pygame.QUIT :
pygame.quit()
quit()
pygame.display.update()