PlayPy 0.3.0__tar.gz → 0.3.1__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.
- {playpy-0.3.0/src/PlayPy.egg-info → playpy-0.3.1}/PKG-INFO +2 -2
- {playpy-0.3.0 → playpy-0.3.1}/README.md +1 -1
- {playpy-0.3.0 → playpy-0.3.1}/pyproject.toml +1 -1
- {playpy-0.3.0 → playpy-0.3.1/src/PlayPy.egg-info}/PKG-INFO +2 -2
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/__init__.py +1 -1
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/builtin/components.py +2 -2
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/core/resources.py +1 -1
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/core/workspace.py +30 -26
- {playpy-0.3.0 → playpy-0.3.1}/LICENSE.txt +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/setup.cfg +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/PlayPy.egg-info/SOURCES.txt +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/PlayPy.egg-info/dependency_links.txt +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/PlayPy.egg-info/requires.txt +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/PlayPy.egg-info/top_level.txt +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/builtin/__init__.py +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/builtin/effects.py +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/builtin/elements.py +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/builtin/events.py +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/core/__init__.py +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/core/elements.py +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/core/state.py +0 -0
- {playpy-0.3.0 → playpy-0.3.1}/src/playpy/data/default_icon.ppm +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PlayPy
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: PlayPy is a lightweight Python library for creating simple games and interactive applications with ease. It provides a straightforward API for handling graphics, input, and basic game mechanics, making it ideal for beginners and those looking to quickly prototype their ideas.
|
|
5
5
|
Author-email: angel <angyv2861@gmail.com>
|
|
6
6
|
Requires-Python: >=3.14
|
|
@@ -10,7 +10,7 @@ Requires-Dist: pygame-ce>=2.5.6
|
|
|
10
10
|
Requires-Dist: colorama>=0.4.6
|
|
11
11
|
Dynamic: license-file
|
|
12
12
|
|
|
13
|
-
# PlayPy (0.3.
|
|
13
|
+
# PlayPy (0.3.1)
|
|
14
14
|
|
|
15
15
|
PlayPy is a lightweight Python library for creating games, tools, and interactive applications using a retained-mode UI and scene system built on top of pygame. It focuses on rapid prototyping, composable rendering, and simple but powerful layout primitives.
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# PlayPy (0.3.
|
|
1
|
+
# PlayPy (0.3.1)
|
|
2
2
|
|
|
3
3
|
PlayPy is a lightweight Python library for creating games, tools, and interactive applications using a retained-mode UI and scene system built on top of pygame. It focuses on rapid prototyping, composable rendering, and simple but powerful layout primitives.
|
|
4
4
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PlayPy"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "PlayPy is a lightweight Python library for creating simple games and interactive applications with ease. It provides a straightforward API for handling graphics, input, and basic game mechanics, making it ideal for beginners and those looking to quickly prototype their ideas."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.14"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PlayPy
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: PlayPy is a lightweight Python library for creating simple games and interactive applications with ease. It provides a straightforward API for handling graphics, input, and basic game mechanics, making it ideal for beginners and those looking to quickly prototype their ideas.
|
|
5
5
|
Author-email: angel <angyv2861@gmail.com>
|
|
6
6
|
Requires-Python: >=3.14
|
|
@@ -10,7 +10,7 @@ Requires-Dist: pygame-ce>=2.5.6
|
|
|
10
10
|
Requires-Dist: colorama>=0.4.6
|
|
11
11
|
Dynamic: license-file
|
|
12
12
|
|
|
13
|
-
# PlayPy (0.3.
|
|
13
|
+
# PlayPy (0.3.1)
|
|
14
14
|
|
|
15
15
|
PlayPy is a lightweight Python library for creating games, tools, and interactive applications using a retained-mode UI and scene system built on top of pygame. It focuses on rapid prototyping, composable rendering, and simple but powerful layout primitives.
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
r'''
|
|
2
|
-
# PlayPy (0.3.
|
|
2
|
+
# PlayPy (0.3.1)
|
|
3
3
|
|
|
4
4
|
PlayPy is a lightweight Python library for creating games, tools, and interactive applications using a retained-mode UI and scene system built on top of pygame. It focuses on rapid prototyping, composable rendering, and simple but powerful layout primitives.
|
|
5
5
|
|
|
@@ -74,9 +74,9 @@ class Scrollable(Camera):
|
|
|
74
74
|
self.scroll_speed = scroll_speed
|
|
75
75
|
|
|
76
76
|
def scroll_x(self, amt: int, min_scroll: int, max_scroll: int):
|
|
77
|
-
self.x
|
|
77
|
+
self.x -= amt * self.scroll_speed
|
|
78
78
|
self.x = max(min_scroll, min(max_scroll, self.x))
|
|
79
79
|
|
|
80
80
|
def scroll_y(self, amt: int, min_scroll: int, max_scroll: int):
|
|
81
|
-
self.y
|
|
81
|
+
self.y -= amt * self.scroll_speed
|
|
82
82
|
self.y = max(min_scroll, min(max_scroll, self.y))
|
|
@@ -190,38 +190,42 @@ class Workspace:
|
|
|
190
190
|
def get_element_rect(self, element: Element) -> pg.Rect:
|
|
191
191
|
parent = element.parent
|
|
192
192
|
if isinstance(parent, Element):
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
193
|
+
parent_rect = self.get_element_rect(parent)
|
|
194
|
+
layout_rect = parent_rect.copy()
|
|
195
|
+
|
|
196
|
+
if not element.ignores_environment:
|
|
197
|
+
camera = parent.get_component(Camera)
|
|
198
|
+
if camera is not None:
|
|
199
|
+
layout_rect.x -= int(camera.x)
|
|
200
|
+
layout_rect.y -= int(camera.y)
|
|
201
|
+
|
|
202
|
+
scrollable = parent.get_component(Scrollable)
|
|
203
|
+
if scrollable is not None:
|
|
204
|
+
layout_rect.x -= int(scrollable.x)
|
|
205
|
+
layout_rect.y -= int(scrollable.y)
|
|
203
206
|
else:
|
|
204
|
-
|
|
207
|
+
parent_rect = pg.Rect((0, 0), self.size)
|
|
208
|
+
layout_rect = parent_rect.copy()
|
|
205
209
|
|
|
206
210
|
padding = element.parent.get_component(Padding) if isinstance(element.parent, Element) and not element.ignores_environment else None
|
|
207
211
|
|
|
208
|
-
rect_x = round(element.scale.x *
|
|
209
|
-
rect_y = round(element.scale.y *
|
|
210
|
-
rect_w = round(element.scale.w *
|
|
211
|
-
rect_h = round(element.scale.h *
|
|
212
|
+
rect_x = round(element.scale.x * layout_rect.w) + element.offset.x + layout_rect.x
|
|
213
|
+
rect_y = round(element.scale.y * layout_rect.h) + element.offset.y + layout_rect.y
|
|
214
|
+
rect_w = round(element.scale.w * layout_rect.w) + element.offset.w
|
|
215
|
+
rect_h = round(element.scale.h * layout_rect.h) + element.offset.h
|
|
212
216
|
|
|
213
217
|
rect = pg.Rect(rect_x, rect_y, rect_w, rect_h)
|
|
214
218
|
|
|
215
219
|
if padding:
|
|
216
|
-
pad_x = round(padding.scale *
|
|
217
|
-
pad_y = round(padding.scale *
|
|
220
|
+
pad_x = round(padding.scale * parent_rect.w) + padding.offset
|
|
221
|
+
pad_y = round(padding.scale * parent_rect.h) + padding.offset
|
|
218
222
|
|
|
219
|
-
inner_rect =
|
|
223
|
+
inner_rect = parent_rect.inflate(-pad_x * 2, -pad_y * 2)
|
|
220
224
|
|
|
221
225
|
# Left side
|
|
222
226
|
dist = None
|
|
223
|
-
if rect.x <
|
|
224
|
-
dist = inner_rect.x -
|
|
227
|
+
if rect.x < parent_rect.x:
|
|
228
|
+
dist = inner_rect.x - parent_rect.x
|
|
225
229
|
elif rect.x < inner_rect.x:
|
|
226
230
|
dist = inner_rect.x - rect.x
|
|
227
231
|
if dist:
|
|
@@ -229,15 +233,15 @@ class Workspace:
|
|
|
229
233
|
rect.w -= dist
|
|
230
234
|
|
|
231
235
|
# Right side
|
|
232
|
-
if rect.right >
|
|
233
|
-
rect.w += inner_rect.right -
|
|
236
|
+
if rect.right > parent_rect.right:
|
|
237
|
+
rect.w += inner_rect.right - parent_rect.right
|
|
234
238
|
elif rect.right > inner_rect.right:
|
|
235
239
|
rect.w = inner_rect.right - rect.x
|
|
236
240
|
|
|
237
241
|
# Top side
|
|
238
242
|
dist = None
|
|
239
|
-
if rect.y <
|
|
240
|
-
dist = inner_rect.y -
|
|
243
|
+
if rect.y < parent_rect.y:
|
|
244
|
+
dist = inner_rect.y - parent_rect.y
|
|
241
245
|
elif rect.y < inner_rect.y:
|
|
242
246
|
dist = inner_rect.y - rect.y
|
|
243
247
|
if dist:
|
|
@@ -245,8 +249,8 @@ class Workspace:
|
|
|
245
249
|
rect.h -= dist
|
|
246
250
|
|
|
247
251
|
# Bottom side
|
|
248
|
-
if rect.bottom >
|
|
249
|
-
rect.h += inner_rect.bottom -
|
|
252
|
+
if rect.bottom > parent_rect.bottom:
|
|
253
|
+
rect.h += inner_rect.bottom - parent_rect.bottom
|
|
250
254
|
elif rect.bottom > inner_rect.bottom:
|
|
251
255
|
rect.h = inner_rect.bottom - rect.y
|
|
252
256
|
|
|
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
|
|
File without changes
|