-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.py
44 lines (31 loc) · 1003 Bytes
/
functions.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
import ctypes
from scene.nodes import SceneView
user32 = ctypes.windll.user32
user32.SetProcessDPIAware()
PORTRAIT = 1 # todo add values
LANDSCAPE = 1
def run(scene_to_run, orientation=0, frame_interval=1, anti_alias=False, show_fps=False, multi_touch=True):
sv = SceneView()
if orientation == PORTRAIT:
ui_orientations = ['portrait']
elif orientation == LANDSCAPE:
ui_orientations = ['landscape']
else:
ui_orientations = None
sv.anti_alias = anti_alias
sv.frame_interval = frame_interval
sv.multi_touch_enabled = multi_touch
sv.shows_fps = show_fps
sv.scene = scene_to_run
sv.present(orientations=ui_orientations)
def gravity():
return 0, 0, 0
def get_screen_size():
return 768, 1024
# return user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)
def get_screen_scale():
return 1.0
def get_image_path(name): # TODO implement
return name
def get_controllers(): # TODO add controller support
return