VertexEngine 1.9.4__tar.gz → 1.9.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vertexengine-1.9.4/src/VertexEngine.egg-info → vertexengine-1.9.6}/PKG-INFO +17 -27
- {vertexengine-1.9.4 → vertexengine-1.9.6}/README.md +13 -23
- {vertexengine-1.9.4 → vertexengine-1.9.6}/pyproject.toml +1 -1
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/InputSystem/KeyInputs.py +9 -3
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/PygameVWidgets/__init__.py +71 -9
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/assets.py +6 -1
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/audio.py +2 -1
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/engine.py +5 -4
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/scenes.py +11 -6
- {vertexengine-1.9.4 → vertexengine-1.9.6/src/VertexEngine.egg-info}/PKG-INFO +17 -27
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine.egg-info/SOURCES.txt +2 -1
- vertexengine-1.9.6/tests/test_pygame_vwidgets_style.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/LICENSE +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/setup.cfg +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/Collisions/__init__.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/Collisions/collisions.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/InputSystem/BtnInputs.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/InputSystem/Events.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/Math/_Vector2.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/Math/__init__.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/Vertex/__init__.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexScreenModifiers.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/ChatBubble.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/CheckBox.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/Counter.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/Dropdown.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/List.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/OptionBtnWidget.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/StatusLight.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/ToggleSwitch.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/WindowMods.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/Windows.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/BasicWidgets/SimpleGUI.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/WHY.mp3 +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/__init__.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/_base.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/examples/MajorSystemTest/Wangi.png +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/examples/MajorSystemTest/main.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/examples/MajorSystemTest/universfield-ui-button-click-147358.mp3 +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/examples/games/snake/main.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/examples/pygwidget_test.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/examples/test.py +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine.egg-info/dependency_links.txt +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine.egg-info/requires.txt +0 -0
- {vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: VertexEngine
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.6
|
|
4
4
|
Summary: A high-performance SDK for Python Development.
|
|
5
5
|
Author-email: Tyrel Miguel <annbasilan0828@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -52,14 +52,18 @@ Dynamic: license-file
|
|
|
52
52
|
VertexEngine is a GUI and Game Engine for python applications, it works best if you use py installer
|
|
53
53
|
|
|
54
54
|
## Official Extensions:
|
|
55
|
-
- [VertexEngine-
|
|
55
|
+
- [VertexEngine-JSON](https://pypi.org/project/VertexEngine-json)
|
|
56
56
|
- [VertexEngine-CLI](https://pypi.org/project/VertexEngine-CLI/1.0/)
|
|
57
57
|
|
|
58
58
|
## Help
|
|
59
59
|
- The documentation is in the following link: [Documentation](https://vertexenginedocs.netlify.app/) for help.
|
|
60
60
|
- Support Email: FinalFacility0828@gmail.com
|
|
61
61
|
|
|
62
|
-
## Change Logs (1.
|
|
62
|
+
## Change Logs (1.8rc1 - 1.9.6)
|
|
63
|
+
### 1.9.6
|
|
64
|
+
- Engine Optimizations
|
|
65
|
+
### 1.9.5
|
|
66
|
+
- Widget Fixes
|
|
63
67
|
### 1.9.4
|
|
64
68
|
- NEW ENGINE FLAG: resizable (bool)
|
|
65
69
|
### 1.9.3
|
|
@@ -116,30 +120,16 @@ VertexEngine is a GUI and Game Engine for python applications, it works best if
|
|
|
116
120
|
### 1.8rc1
|
|
117
121
|
- Patched some runtime errors
|
|
118
122
|
- Added MATH! (from VertexEngine.math import *)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- official VertexEngine Projects Browser! (RainExplorer)
|
|
127
|
-
- Accounts Wiped soon.
|
|
128
|
-
- Fixed a bit too many bugs.
|
|
129
|
-
### 1.7.0
|
|
130
|
-
- Fixed Collision not defined errors
|
|
131
|
-
- Added an official3 Tutorial Video!
|
|
132
|
-
- Accounts will be wiped soon.
|
|
133
|
-
|
|
134
|
-
## How to install VertexEngine/Vertex:
|
|
135
|
-
Step 1: Type in pip install VertexEngine
|
|
136
|
-
|
|
137
|
-
Step 2: Wait a few min, don't worry if it takes 1 hr or more, it will finish
|
|
138
|
-
|
|
139
|
-
Pygame or PyQt6 systems are compatible with Vertex so you can use pygame collision system or PyQt6's UI system in VertexEngine.
|
|
123
|
+
|
|
124
|
+
## How to install VertexEngine:
|
|
125
|
+
Step 1: Type in `pip install VertexEngine`
|
|
126
|
+
|
|
127
|
+
Step 2: Wait a few minutes.
|
|
128
|
+
|
|
129
|
+
Pygame or PyQt6 systems are compatible with VertexEngine so you can use pygame collision system or PyQt6's UI system in VertexEngine.
|
|
140
130
|
|
|
141
131
|
## Dependencies
|
|
142
|
-
|
|
132
|
+
VertexEngine obviously has heavy dependencies since it's a game engine, the following requirements are:
|
|
143
133
|
|
|
144
134
|
| Dependency | Version |
|
|
145
135
|
|------------------|--------------------------------------|
|
|
@@ -147,10 +137,10 @@ Vertex obviously has heavy dependencies since it's a game engine, the following
|
|
|
147
137
|
| Pygame | >=2.0 |
|
|
148
138
|
| Python | >=3.10 |
|
|
149
139
|
|
|
150
|
-
## About Me
|
|
140
|
+
## About Me
|
|
151
141
|
I’m a solo developer based in Quezon City, building tools and engines for both fun and serious projects.
|
|
152
142
|
|
|
153
|
-
##
|
|
143
|
+
## License
|
|
154
144
|
VertexEngine is licensed under the MIT License.
|
|
155
145
|
|
|
156
146
|
You are free to use, modify, and distribute this project, as long as proper attribution is given. See the LICENSE file for details.
|
|
@@ -17,14 +17,18 @@
|
|
|
17
17
|
VertexEngine is a GUI and Game Engine for python applications, it works best if you use py installer
|
|
18
18
|
|
|
19
19
|
## Official Extensions:
|
|
20
|
-
- [VertexEngine-
|
|
20
|
+
- [VertexEngine-JSON](https://pypi.org/project/VertexEngine-json)
|
|
21
21
|
- [VertexEngine-CLI](https://pypi.org/project/VertexEngine-CLI/1.0/)
|
|
22
22
|
|
|
23
23
|
## Help
|
|
24
24
|
- The documentation is in the following link: [Documentation](https://vertexenginedocs.netlify.app/) for help.
|
|
25
25
|
- Support Email: FinalFacility0828@gmail.com
|
|
26
26
|
|
|
27
|
-
## Change Logs (1.
|
|
27
|
+
## Change Logs (1.8rc1 - 1.9.6)
|
|
28
|
+
### 1.9.6
|
|
29
|
+
- Engine Optimizations
|
|
30
|
+
### 1.9.5
|
|
31
|
+
- Widget Fixes
|
|
28
32
|
### 1.9.4
|
|
29
33
|
- NEW ENGINE FLAG: resizable (bool)
|
|
30
34
|
### 1.9.3
|
|
@@ -81,30 +85,16 @@ VertexEngine is a GUI and Game Engine for python applications, it works best if
|
|
|
81
85
|
### 1.8rc1
|
|
82
86
|
- Patched some runtime errors
|
|
83
87
|
- Added MATH! (from VertexEngine.math import *)
|
|
84
|
-
### 1.7.3
|
|
85
|
-
- Added new functions to collisions!
|
|
86
|
-
### 1.7.2
|
|
87
|
-
- Added HIGHLIGHTING to Ocean Code!**
|
|
88
|
-
- Fixed a lot of bugs!
|
|
89
|
-
- Fixed outdated URLs (2 day server shutdown)
|
|
90
|
-
### 1.7.1
|
|
91
|
-
- official VertexEngine Projects Browser! (RainExplorer)
|
|
92
|
-
- Accounts Wiped soon.
|
|
93
|
-
- Fixed a bit too many bugs.
|
|
94
|
-
### 1.7.0
|
|
95
|
-
- Fixed Collision not defined errors
|
|
96
|
-
- Added an official3 Tutorial Video!
|
|
97
|
-
- Accounts will be wiped soon.
|
|
98
88
|
|
|
99
|
-
## How to install VertexEngine
|
|
100
|
-
Step 1: Type in pip install VertexEngine
|
|
89
|
+
## How to install VertexEngine:
|
|
90
|
+
Step 1: Type in `pip install VertexEngine`
|
|
101
91
|
|
|
102
|
-
Step 2: Wait a few
|
|
92
|
+
Step 2: Wait a few minutes.
|
|
103
93
|
|
|
104
|
-
Pygame or PyQt6 systems are compatible with
|
|
94
|
+
Pygame or PyQt6 systems are compatible with VertexEngine so you can use pygame collision system or PyQt6's UI system in VertexEngine.
|
|
105
95
|
|
|
106
96
|
## Dependencies
|
|
107
|
-
|
|
97
|
+
VertexEngine obviously has heavy dependencies since it's a game engine, the following requirements are:
|
|
108
98
|
|
|
109
99
|
| Dependency | Version |
|
|
110
100
|
|------------------|--------------------------------------|
|
|
@@ -112,10 +102,10 @@ Vertex obviously has heavy dependencies since it's a game engine, the following
|
|
|
112
102
|
| Pygame | >=2.0 |
|
|
113
103
|
| Python | >=3.10 |
|
|
114
104
|
|
|
115
|
-
## About Me
|
|
105
|
+
## About Me
|
|
116
106
|
I’m a solo developer based in Quezon City, building tools and engines for both fun and serious projects.
|
|
117
107
|
|
|
118
|
-
##
|
|
108
|
+
## License
|
|
119
109
|
VertexEngine is licensed under the MIT License.
|
|
120
110
|
|
|
121
111
|
You are free to use, modify, and distribute this project, as long as proper attribution is given. See the LICENSE file for details.
|
|
@@ -160,6 +160,12 @@ class Input:
|
|
|
160
160
|
cls._just_pressed.clear()
|
|
161
161
|
cls._just_released.clear()
|
|
162
162
|
|
|
163
|
+
@classmethod
|
|
164
|
+
def clear(cls):
|
|
165
|
+
cls._pressed.clear()
|
|
166
|
+
cls._just_pressed.clear()
|
|
167
|
+
cls._just_released.clear()
|
|
168
|
+
|
|
163
169
|
@classmethod
|
|
164
170
|
def bind(cls, action, key):
|
|
165
171
|
"""Bind an action name to a key."""
|
|
@@ -195,15 +201,15 @@ class Input:
|
|
|
195
201
|
# === Direct Key API ===
|
|
196
202
|
@classmethod
|
|
197
203
|
def is_pressed(cls, key):
|
|
198
|
-
return KEY_MAP
|
|
204
|
+
return KEY_MAP.get(key, key) in cls._pressed
|
|
199
205
|
|
|
200
206
|
@classmethod
|
|
201
207
|
def is_just_pressed(cls, key):
|
|
202
|
-
return KEY_MAP
|
|
208
|
+
return KEY_MAP.get(key, key) in cls._just_pressed
|
|
203
209
|
|
|
204
210
|
@classmethod
|
|
205
211
|
def is_released(cls, key):
|
|
206
|
-
return KEY_MAP
|
|
212
|
+
return KEY_MAP.get(key, key) in cls._just_released
|
|
207
213
|
|
|
208
214
|
# === Action API ===
|
|
209
215
|
@classmethod
|
{vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/PygameVWidgets/__init__.py
RENAMED
|
@@ -24,6 +24,19 @@ class Style:
|
|
|
24
24
|
padding (int): Internal padding.
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
|
+
_STYLE_ATTRS = (
|
|
28
|
+
"bg_color",
|
|
29
|
+
"hover_color",
|
|
30
|
+
"pressed_color",
|
|
31
|
+
"border_color",
|
|
32
|
+
"text_color",
|
|
33
|
+
"border_radius",
|
|
34
|
+
"border_width",
|
|
35
|
+
"font_name",
|
|
36
|
+
"font_size",
|
|
37
|
+
"padding",
|
|
38
|
+
)
|
|
39
|
+
|
|
27
40
|
def __init__(
|
|
28
41
|
self,
|
|
29
42
|
bg_color=(70, 70, 90),
|
|
@@ -50,6 +63,20 @@ class Style:
|
|
|
50
63
|
self.font_size = font_size
|
|
51
64
|
self.padding = padding
|
|
52
65
|
|
|
66
|
+
@classmethod
|
|
67
|
+
def coerce(cls, style=None):
|
|
68
|
+
"""Return a Style instance, even when a style-like object is passed."""
|
|
69
|
+
if style is None:
|
|
70
|
+
return cls()
|
|
71
|
+
if isinstance(style, cls):
|
|
72
|
+
return style
|
|
73
|
+
|
|
74
|
+
normalized = cls()
|
|
75
|
+
for attr in cls._STYLE_ATTRS:
|
|
76
|
+
if hasattr(style, attr):
|
|
77
|
+
setattr(normalized, attr, getattr(style, attr))
|
|
78
|
+
return normalized
|
|
79
|
+
|
|
53
80
|
|
|
54
81
|
# =========================================================
|
|
55
82
|
# BASE WIDGET
|
|
@@ -82,7 +109,7 @@ class Widget:
|
|
|
82
109
|
self.visible = True
|
|
83
110
|
self.parent = None
|
|
84
111
|
self.children = []
|
|
85
|
-
self.style =
|
|
112
|
+
self.style = Style.coerce(style)
|
|
86
113
|
|
|
87
114
|
self._rect = pygame.Rect(x, y, width, height)
|
|
88
115
|
|
|
@@ -137,20 +164,42 @@ class Button(Widget):
|
|
|
137
164
|
on_click (callable): Click callback.
|
|
138
165
|
hovered (bool): Hover state.
|
|
139
166
|
pressed (bool): Press state.
|
|
167
|
+
image (pygame.Surface | str | None): Optional button image.
|
|
140
168
|
"""
|
|
141
169
|
|
|
142
|
-
def __init__(self, x, y, width, height, text="", on_click=None, style=None):
|
|
170
|
+
def __init__(self, x, y, width, height, text="", on_click=None, style=None, image=None):
|
|
143
171
|
super().__init__(x, y, width, height, style)
|
|
144
172
|
self.text = text
|
|
145
173
|
self.on_click = on_click
|
|
146
174
|
self.hovered = False
|
|
147
175
|
self.pressed = False
|
|
176
|
+
self.image = self._load_image(image)
|
|
148
177
|
|
|
149
178
|
self.font = pygame.font.SysFont(
|
|
150
179
|
self.style.font_name,
|
|
151
180
|
self.style.font_size
|
|
152
181
|
)
|
|
153
182
|
|
|
183
|
+
@staticmethod
|
|
184
|
+
def _load_image(image):
|
|
185
|
+
if image is None:
|
|
186
|
+
return None
|
|
187
|
+
if isinstance(image, str):
|
|
188
|
+
return pygame.image.load(image)
|
|
189
|
+
if isinstance(image, pygame.Surface):
|
|
190
|
+
return image
|
|
191
|
+
return None
|
|
192
|
+
|
|
193
|
+
def _tint_surface(self, image, tint_color, alpha=120):
|
|
194
|
+
if image is None:
|
|
195
|
+
return None
|
|
196
|
+
|
|
197
|
+
tinted = image.copy()
|
|
198
|
+
overlay = pygame.Surface(tinted.get_size(), pygame.SRCALPHA)
|
|
199
|
+
overlay.fill((tint_color[0], tint_color[1], tint_color[2], alpha))
|
|
200
|
+
tinted.blit(overlay, (0, 0), special_flags=pygame.BLEND_RGBA_MULT)
|
|
201
|
+
return tinted
|
|
202
|
+
|
|
154
203
|
def update(self):
|
|
155
204
|
"""Updates hover state."""
|
|
156
205
|
mouse = pygame.mouse.get_pos()
|
|
@@ -174,15 +223,28 @@ class Button(Widget):
|
|
|
174
223
|
if not self.visible:
|
|
175
224
|
return
|
|
176
225
|
|
|
177
|
-
color = self.style.bg_color
|
|
178
|
-
if self.pressed:
|
|
179
|
-
color = self.style.pressed_color
|
|
180
|
-
elif self.hovered:
|
|
181
|
-
color = self.style.hover_color
|
|
182
|
-
|
|
183
226
|
rect = self.rect()
|
|
184
227
|
|
|
185
|
-
|
|
228
|
+
if self.image:
|
|
229
|
+
image = pygame.transform.smoothscale(self.image, rect.size)
|
|
230
|
+
tint_color = None
|
|
231
|
+
if self.pressed:
|
|
232
|
+
tint_color = self.style.pressed_color
|
|
233
|
+
elif self.hovered:
|
|
234
|
+
tint_color = self.style.hover_color
|
|
235
|
+
|
|
236
|
+
if tint_color is not None:
|
|
237
|
+
image = self._tint_surface(image, tint_color, alpha=150)
|
|
238
|
+
|
|
239
|
+
surface.blit(image, rect.topleft)
|
|
240
|
+
else:
|
|
241
|
+
color = self.style.bg_color
|
|
242
|
+
if self.pressed:
|
|
243
|
+
color = self.style.pressed_color
|
|
244
|
+
elif self.hovered:
|
|
245
|
+
color = self.style.hover_color
|
|
246
|
+
|
|
247
|
+
pygame.draw.rect(surface, color, rect, border_radius=self.style.border_radius)
|
|
186
248
|
|
|
187
249
|
if self.text:
|
|
188
250
|
text = self.font.render(self.text, True, self.style.text_color)
|
|
@@ -58,6 +58,10 @@ class AssetManager:
|
|
|
58
58
|
try:
|
|
59
59
|
surface = pygame.image.load(path)
|
|
60
60
|
self.images[name] = surface
|
|
61
|
+
self._scaled_cache = {
|
|
62
|
+
key: value for key, value in self._scaled_cache.items()
|
|
63
|
+
if key[0] != name
|
|
64
|
+
}
|
|
61
65
|
return surface
|
|
62
66
|
|
|
63
67
|
except FileNotFoundError:
|
|
@@ -78,7 +82,7 @@ class AssetManager:
|
|
|
78
82
|
"""
|
|
79
83
|
img = self.images.get(name)
|
|
80
84
|
|
|
81
|
-
if
|
|
85
|
+
if img is None:
|
|
82
86
|
print(f"[Warning] Image '{name}' not loaded!")
|
|
83
87
|
return
|
|
84
88
|
|
|
@@ -88,6 +92,7 @@ class AssetManager:
|
|
|
88
92
|
return
|
|
89
93
|
|
|
90
94
|
# Use cache key
|
|
95
|
+
size = tuple(size)
|
|
91
96
|
cache_key = (name, size)
|
|
92
97
|
|
|
93
98
|
# Check if scaled version exists
|
|
@@ -3,7 +3,8 @@ import pygame
|
|
|
3
3
|
class AudioManager:
|
|
4
4
|
"""The `AudioManager` class allows you to play audio in your VertexEngine app. It has only 4 functions for sound and music."""
|
|
5
5
|
def __init__(self):
|
|
6
|
-
pygame.mixer.
|
|
6
|
+
if not pygame.mixer.get_init():
|
|
7
|
+
pygame.mixer.init()
|
|
7
8
|
self.sounds = {}
|
|
8
9
|
self.music = None
|
|
9
10
|
|
|
@@ -42,14 +42,14 @@ class GameEngine(QWidget):
|
|
|
42
42
|
"""Helper to sync the Pygame surface into a Qt-friendly image buffer."""
|
|
43
43
|
# Always rebuild the image from the current frame so the Qt widget
|
|
44
44
|
# doesn't keep rendering the stale black buffer created at startup.
|
|
45
|
-
|
|
45
|
+
self._frame_bytes = pygame.image.tobytes(self.screen, "RGB")
|
|
46
46
|
self.img = QImage(
|
|
47
|
-
|
|
47
|
+
self._frame_bytes,
|
|
48
48
|
self.width,
|
|
49
49
|
self.height,
|
|
50
50
|
self.width * 3,
|
|
51
51
|
QImage.Format.Format_RGB888
|
|
52
|
-
)
|
|
52
|
+
)
|
|
53
53
|
|
|
54
54
|
# ---------------------- RENDER ----------------------
|
|
55
55
|
|
|
@@ -71,13 +71,14 @@ class GameEngine(QWidget):
|
|
|
71
71
|
|
|
72
72
|
def _update_frame(self):
|
|
73
73
|
if not self.hasFocus():
|
|
74
|
-
|
|
74
|
+
Input.clear()
|
|
75
75
|
|
|
76
76
|
# Optimized: Clear and draw into the pygame surface during the update step
|
|
77
77
|
self.screen.fill(self.color)
|
|
78
78
|
self.scene_manager._update()
|
|
79
79
|
self.scene_manager.draw(self.screen)
|
|
80
80
|
self._sync_qimage()
|
|
81
|
+
Input.input_update()
|
|
81
82
|
|
|
82
83
|
# Schedule the visual swap
|
|
83
84
|
self.update()
|
|
@@ -57,6 +57,8 @@ class SceneManager:
|
|
|
57
57
|
self.current_scene = None
|
|
58
58
|
|
|
59
59
|
def set_scene(self, scene):
|
|
60
|
+
if scene is self.current_scene:
|
|
61
|
+
return
|
|
60
62
|
if self.current_scene:
|
|
61
63
|
self.current_scene.on_exit()
|
|
62
64
|
self.current_scene.hide()
|
|
@@ -66,13 +68,16 @@ class SceneManager:
|
|
|
66
68
|
self.current_scene.on_enter()
|
|
67
69
|
|
|
68
70
|
def _update(self):
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
scene = self.current_scene
|
|
72
|
+
if scene is not None:
|
|
73
|
+
scene.update()
|
|
71
74
|
|
|
72
75
|
def draw(self, surface):
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
scene = self.current_scene
|
|
77
|
+
if scene is not None:
|
|
78
|
+
scene.draw(surface)
|
|
75
79
|
|
|
76
80
|
def handle_event(self, event):
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
scene = self.current_scene
|
|
82
|
+
if scene is not None:
|
|
83
|
+
scene.handle_event(event)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: VertexEngine
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.6
|
|
4
4
|
Summary: A high-performance SDK for Python Development.
|
|
5
5
|
Author-email: Tyrel Miguel <annbasilan0828@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -52,14 +52,18 @@ Dynamic: license-file
|
|
|
52
52
|
VertexEngine is a GUI and Game Engine for python applications, it works best if you use py installer
|
|
53
53
|
|
|
54
54
|
## Official Extensions:
|
|
55
|
-
- [VertexEngine-
|
|
55
|
+
- [VertexEngine-JSON](https://pypi.org/project/VertexEngine-json)
|
|
56
56
|
- [VertexEngine-CLI](https://pypi.org/project/VertexEngine-CLI/1.0/)
|
|
57
57
|
|
|
58
58
|
## Help
|
|
59
59
|
- The documentation is in the following link: [Documentation](https://vertexenginedocs.netlify.app/) for help.
|
|
60
60
|
- Support Email: FinalFacility0828@gmail.com
|
|
61
61
|
|
|
62
|
-
## Change Logs (1.
|
|
62
|
+
## Change Logs (1.8rc1 - 1.9.6)
|
|
63
|
+
### 1.9.6
|
|
64
|
+
- Engine Optimizations
|
|
65
|
+
### 1.9.5
|
|
66
|
+
- Widget Fixes
|
|
63
67
|
### 1.9.4
|
|
64
68
|
- NEW ENGINE FLAG: resizable (bool)
|
|
65
69
|
### 1.9.3
|
|
@@ -116,30 +120,16 @@ VertexEngine is a GUI and Game Engine for python applications, it works best if
|
|
|
116
120
|
### 1.8rc1
|
|
117
121
|
- Patched some runtime errors
|
|
118
122
|
- Added MATH! (from VertexEngine.math import *)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- official VertexEngine Projects Browser! (RainExplorer)
|
|
127
|
-
- Accounts Wiped soon.
|
|
128
|
-
- Fixed a bit too many bugs.
|
|
129
|
-
### 1.7.0
|
|
130
|
-
- Fixed Collision not defined errors
|
|
131
|
-
- Added an official3 Tutorial Video!
|
|
132
|
-
- Accounts will be wiped soon.
|
|
133
|
-
|
|
134
|
-
## How to install VertexEngine/Vertex:
|
|
135
|
-
Step 1: Type in pip install VertexEngine
|
|
136
|
-
|
|
137
|
-
Step 2: Wait a few min, don't worry if it takes 1 hr or more, it will finish
|
|
138
|
-
|
|
139
|
-
Pygame or PyQt6 systems are compatible with Vertex so you can use pygame collision system or PyQt6's UI system in VertexEngine.
|
|
123
|
+
|
|
124
|
+
## How to install VertexEngine:
|
|
125
|
+
Step 1: Type in `pip install VertexEngine`
|
|
126
|
+
|
|
127
|
+
Step 2: Wait a few minutes.
|
|
128
|
+
|
|
129
|
+
Pygame or PyQt6 systems are compatible with VertexEngine so you can use pygame collision system or PyQt6's UI system in VertexEngine.
|
|
140
130
|
|
|
141
131
|
## Dependencies
|
|
142
|
-
|
|
132
|
+
VertexEngine obviously has heavy dependencies since it's a game engine, the following requirements are:
|
|
143
133
|
|
|
144
134
|
| Dependency | Version |
|
|
145
135
|
|------------------|--------------------------------------|
|
|
@@ -147,10 +137,10 @@ Vertex obviously has heavy dependencies since it's a game engine, the following
|
|
|
147
137
|
| Pygame | >=2.0 |
|
|
148
138
|
| Python | >=3.10 |
|
|
149
139
|
|
|
150
|
-
## About Me
|
|
140
|
+
## About Me
|
|
151
141
|
I’m a solo developer based in Quezon City, building tools and engines for both fun and serious projects.
|
|
152
142
|
|
|
153
|
-
##
|
|
143
|
+
## License
|
|
154
144
|
VertexEngine is licensed under the MIT License.
|
|
155
145
|
|
|
156
146
|
You are free to use, modify, and distribute this project, as long as proper attribution is given. See the LICENSE file for details.
|
|
@@ -40,4 +40,5 @@ src/VertexEngine/examples/test.py
|
|
|
40
40
|
src/VertexEngine/examples/MajorSystemTest/Wangi.png
|
|
41
41
|
src/VertexEngine/examples/MajorSystemTest/main.py
|
|
42
42
|
src/VertexEngine/examples/MajorSystemTest/universfield-ui-button-click-147358.mp3
|
|
43
|
-
src/VertexEngine/examples/games/snake/main.py
|
|
43
|
+
src/VertexEngine/examples/games/snake/main.py
|
|
44
|
+
tests/test_pygame_vwidgets_style.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/Counter.py
RENAMED
|
File without changes
|
|
File without changes
|
{vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/List.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/AdvancedVWidgets/Windows.py
RENAMED
|
File without changes
|
{vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/VertexWidgets/BasicWidgets/SimpleGUI.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vertexengine-1.9.4 → vertexengine-1.9.6}/src/VertexEngine/examples/MajorSystemTest/Wangi.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|