-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.py
More file actions
108 lines (74 loc) · 4.41 KB
/
process.py
File metadata and controls
108 lines (74 loc) · 4.41 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
### ====================================================================================================
### IMPORTS
### ====================================================================================================
import arcade
from utils import *
class Process:
### ====================================================================================================
### PARAMETERS
### ====================================================================================================
SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 675
### ====================================================================================================
### CONSTRUCTOR
### ====================================================================================================
def __init__(self):
pass
### ====================================================================================================
### INIT
### ====================================================================================================
def setup(self):
pass
### ====================================================================================================
### UPDATE
### ====================================================================================================
def update(self,deltaTime):
pass
### ====================================================================================================
### RENDERING
### ====================================================================================================
def draw(self):
message = "INSTALL OK" + "\n"
message += "- Press any key from keyboard" + "\n"
message += "- Press any button from controllers" + "\n"
message += "- Move any stick from controllers" + "\n"
message += "- Press any button from mouse" + "\n"
message += "- Move the mouse in any direction" + "\n"
message += "==> See information on the output console" + "\n"
paramTxt = {"x": self.SCREEN_WIDTH//2,
"y": self.SCREEN_HEIGHT//2,
"alignH": "center",
"alignV": "center",
"message": message,
"size": 50,
"color": (160, 255, 160, 255),
}
drawText(paramTxt)
### ====================================================================================================
### KEYBOARD EVENTS
### key is taken from : arcade.key.xxx
### ====================================================================================================
def onKeyEvent(self,key,isPressed):
print(f"key={key} - isPressed={isPressed}")
### ====================================================================================================
### GAMEPAD BUTTON EVENTS
### buttonName can be "A", "B", "X", "Y", "LB", "RB", "VIEW", "MENU", "LSTICK", "RSTICK"
### ====================================================================================================
def onButtonEvent(self, gamepadNum,buttonName,isPressed):
print(f"GamePad={gamepadNum} - ButtonNum={buttonName} - isPressed={isPressed}")
### ====================================================================================================
### GAMEPAD AXIS EVENTS
### axisName can be "X", "Y", "RX", "RY", "Z"
### ====================================================================================================
def onAxisEvent(self, gamepadNum,axisName,analogValue):
print(f"GamePad={gamepadNum} - AxisName={axisName} - Value={analogValue}")
### ====================================================================================================
### MOUSE MOTION EVENTS
### ====================================================================================================
def onMouseMotionEvent(self,x,y,dx,dy):
print(f"MOUSE MOTION : x={x}/y={y} dx={dx}/dy={dy}")
### ====================================================================================================
### MOUSE BUTTON EVENTS
### ====================================================================================================
def onMouseButtonEvent(self,x,y,buttonNum,isPressed):
print(f"MOUSE BUTTON : x={x}/y={y} buttonNum={buttonNum} isPressed={isPressed}")