crystalwindow 3.8.3__py3-none-any.whl → 3.8.4__py3-none-any.whl
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.
- crystalwindow/__init__.py +4 -0
- crystalwindow/assets.py +41 -0
- crystalwindow/sprites.py +1 -1
- {crystalwindow-3.8.3.dist-info → crystalwindow-3.8.4.dist-info}/METADATA +1 -1
- {crystalwindow-3.8.3.dist-info → crystalwindow-3.8.4.dist-info}/RECORD +8 -8
- {crystalwindow-3.8.3.dist-info → crystalwindow-3.8.4.dist-info}/licenses/LICENSE +1 -1
- {crystalwindow-3.8.3.dist-info → crystalwindow-3.8.4.dist-info}/WHEEL +0 -0
- {crystalwindow-3.8.3.dist-info → crystalwindow-3.8.4.dist-info}/top_level.txt +0 -0
crystalwindow/__init__.py
CHANGED
|
@@ -20,6 +20,8 @@ from .assets import (
|
|
|
20
20
|
flip_image,
|
|
21
21
|
flip_horizontal,
|
|
22
22
|
flip_vertical,
|
|
23
|
+
LoopAnim,
|
|
24
|
+
loop_image,
|
|
23
25
|
)
|
|
24
26
|
from .animation import Animation
|
|
25
27
|
|
|
@@ -60,6 +62,8 @@ __all__ = [
|
|
|
60
62
|
"flip_horizontal",
|
|
61
63
|
"flip_vertical",
|
|
62
64
|
"Animation",
|
|
65
|
+
"LoopAnim",
|
|
66
|
+
"loop_image",
|
|
63
67
|
|
|
64
68
|
# --- Collision ---
|
|
65
69
|
"check_collision", "resolve_collision",
|
crystalwindow/assets.py
CHANGED
|
@@ -118,6 +118,47 @@ def flip_horizontal(img):
|
|
|
118
118
|
def flip_vertical(img):
|
|
119
119
|
return flip_image(img, flip_v=True)
|
|
120
120
|
|
|
121
|
+
# --------------------------------------------------------
|
|
122
|
+
# LOOPING ANIMAITONS/IMAGES
|
|
123
|
+
# --------------------------------------------------------
|
|
124
|
+
class LoopAnim:
|
|
125
|
+
def __init__(self, frames, speed=0.2):
|
|
126
|
+
self.frames = frames
|
|
127
|
+
self.i = 0
|
|
128
|
+
self.speed = speed
|
|
129
|
+
|
|
130
|
+
def next(self):
|
|
131
|
+
"""Return next frame automatically looping."""
|
|
132
|
+
if not self.frames:
|
|
133
|
+
return None
|
|
134
|
+
|
|
135
|
+
self.i += self.speed
|
|
136
|
+
if self.i >= len(self.frames):
|
|
137
|
+
self.i = 0
|
|
138
|
+
|
|
139
|
+
return self.frames[int(self.i)]
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def loop_image(*imgs, speed=0.2):
|
|
143
|
+
"""
|
|
144
|
+
Usage:
|
|
145
|
+
anim = loop_image(img1, img2, img3)
|
|
146
|
+
anim = loop_image(load_image("p1.png"), load_image("p2.png"))
|
|
147
|
+
|
|
148
|
+
Returns a LoopAnim object.
|
|
149
|
+
"""
|
|
150
|
+
frames = [x for x in imgs if x is not None]
|
|
151
|
+
|
|
152
|
+
# If nothing was passed → fallback
|
|
153
|
+
if not frames:
|
|
154
|
+
print("⚠️ loop_image() got no frames.")
|
|
155
|
+
fb = load_image("fallback.png") if os.path.exists("fallback.png") else None
|
|
156
|
+
if fb is None:
|
|
157
|
+
return LoopAnim([None], speed=speed)
|
|
158
|
+
return LoopAnim([fb], speed=speed)
|
|
159
|
+
|
|
160
|
+
return LoopAnim(frames, speed=speed)
|
|
161
|
+
|
|
121
162
|
|
|
122
163
|
# --------------------------------------------------------
|
|
123
164
|
# FOLDER LOADING
|
crystalwindow/sprites.py
CHANGED
|
@@ -90,7 +90,7 @@ class Sprite:
|
|
|
90
90
|
self.x + getattr(self, "width", 0) > other.x and
|
|
91
91
|
self.y < other.y + getattr(other, "height", 0) and
|
|
92
92
|
self.y + getattr(self, "height", 0) > other.y
|
|
93
|
-
)
|
|
93
|
+
) # returns tuple for consistency
|
|
94
94
|
|
|
95
95
|
def set_image(self, img):
|
|
96
96
|
"""Update sprite's image at runtime (like flipping)"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crystalwindow
|
|
3
|
-
Version: 3.8.
|
|
3
|
+
Version: 3.8.4
|
|
4
4
|
Summary: A Tkinter powered window + GUI toolkit made by Crystal (MEEEEEE)! Easier apps, smoother UI and all-in-one helpers!
|
|
5
5
|
Home-page: https://pypi.org/project/crystalwindow/
|
|
6
6
|
Author: CrystalBallyHereXD
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
crystalwindow/FileHelper.py,sha256=aUnnRG7UwvzJt-idjWjmpwy3RM6nqLlC3-7Bae6Yb94,5471
|
|
2
|
-
crystalwindow/__init__.py,sha256=
|
|
2
|
+
crystalwindow/__init__.py,sha256=c8-c4hLW3AhIN9J8uNVGSTz6Navsfs7FGexV55lkP6g,2083
|
|
3
3
|
crystalwindow/animation.py,sha256=zHjrdBXQeyNaLAuaGPldJueX05OZ5j31YR8NizmR0uQ,427
|
|
4
|
-
crystalwindow/assets.py,sha256=
|
|
4
|
+
crystalwindow/assets.py,sha256=2Cj0zdhMWo3mWjdr9KU5n-9_8iKj_fJ9uShMFA-27HU,5193
|
|
5
5
|
crystalwindow/camera.py,sha256=tbn4X-jxMIszAUg3Iu-89gJN5nij0mjPMEzGotcLbJI,712
|
|
6
6
|
crystalwindow/clock.py,sha256=iryeURnfXx6TIDyJhpxe0KkeSaHCdxrMckN6Tby00i0,461
|
|
7
7
|
crystalwindow/collision.py,sha256=hpkHTp_KparghVK-itp_rxuYdd2GbQMxICHlUBv0rSw,472
|
|
@@ -16,7 +16,7 @@ crystalwindow/gui.py,sha256=D-El18XUaZQR-XZoOr28hnhO7EEoGuypCHxPbPR_yng,3680
|
|
|
16
16
|
crystalwindow/gui_ext.py,sha256=ZhNgc5eK6Vzj-jUNeFzimuEbLnTmM7Bx594Z34_N0oM,2856
|
|
17
17
|
crystalwindow/math.py,sha256=slOY3KQZ99VDMUMxsSJabMyRtJcwVzEyxR2RoXspHho,963
|
|
18
18
|
crystalwindow/player.py,sha256=4wpIdUZLTlRXV8fDRQ11yVJRbx_cv8Ekpn2y7pQGgAQ,3442
|
|
19
|
-
crystalwindow/sprites.py,sha256=
|
|
19
|
+
crystalwindow/sprites.py,sha256=2kYW4QfSnyUwRLedZCkb99wUSxn2a0JdWOHcfkxcG0U,3411
|
|
20
20
|
crystalwindow/tilemap.py,sha256=PHoKL1eWuNeHIf0w-Jh5MGdQGEgklVsxqqJOS-GNMKI,322
|
|
21
21
|
crystalwindow/ver_warner.py,sha256=qEN3ulc1NixBy15FFx2R3Zu0DhyJTVJwiESGAPwpynM,3373
|
|
22
22
|
crystalwindow/window.py,sha256=e6C8yIdVdjOduIeU0ZmlrNn8GmyvHuzKs473pRggkz0,18180
|
|
@@ -31,8 +31,8 @@ crystalwindow/gametests/guitesting.py,sha256=SrOssY5peCQEV6TQ1AiOWtjb9phVGdRzW-Q
|
|
|
31
31
|
crystalwindow/gametests/sandbox.py,sha256=Oo2tU2N0y3BPVa6T5vs_h9N6islhQrjSrr_78XLut5I,1007
|
|
32
32
|
crystalwindow/gametests/squaremove.py,sha256=poP2Zjl2oc2HVvIAgIK34H2jVj6otL4jEdvAOR6L9sI,572
|
|
33
33
|
crystalwindow/gametests/windowtesting.py,sha256=_9X6wnV1-_X_PtNS-0zu-k209NtFIwAc4vpxLPp7V2o,97
|
|
34
|
-
crystalwindow-3.8.
|
|
35
|
-
crystalwindow-3.8.
|
|
36
|
-
crystalwindow-3.8.
|
|
37
|
-
crystalwindow-3.8.
|
|
38
|
-
crystalwindow-3.8.
|
|
34
|
+
crystalwindow-3.8.4.dist-info/licenses/LICENSE,sha256=Gt5cJRchdNt0guxyQMHKsATN5PM5mjuDhdO6Gzs9qQc,1096
|
|
35
|
+
crystalwindow-3.8.4.dist-info/METADATA,sha256=sNkJRxTwkTfPeCtzmhkyLMV0FA8NDjLKxgZ5GTVmxv4,7340
|
|
36
|
+
crystalwindow-3.8.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
+
crystalwindow-3.8.4.dist-info/top_level.txt,sha256=PeQSld4b19XWT-zvbYkvE2Xg8sakIMbDzSzSdOSRN8o,14
|
|
38
|
+
crystalwindow-3.8.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|