crystalwindow 3.6.post3__tar.gz → 3.6.post4__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.
- {crystalwindow-3.6.post3/crystalwindow.egg-info → crystalwindow-3.6.post4}/PKG-INFO +1 -1
- crystalwindow-3.6.post4/crystalwindow/camera.py +19 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/sprites.py +8 -3
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4/crystalwindow.egg-info}/PKG-INFO +1 -1
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow.egg-info/SOURCES.txt +1 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/setup.py +1 -1
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/LICENSE +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/MANIFEST.in +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/README.md +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/FileHelper.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/Icons/default_icon.png +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/__init__.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/animation.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/assets.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/clock.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/collision.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/crystal3d.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/docs/getting_started.md +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/docs/index.md +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/draw_helpers.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/draw_rects.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/draw_text_helper.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/draw_tool.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/fun_helpers.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/3dsquare.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/__init__.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/__main__.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/gravitytest.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/guitesting.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/sandbox.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/squaremove.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/windowtesting.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gravity.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gui.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gui_ext.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/math.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/player.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/tilemap.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/ver_warner.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/window.py +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow.egg-info/dependency_links.txt +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow.egg-info/top_level.txt +0 -0
- {crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crystalwindow
|
|
3
|
-
Version: 3.6.
|
|
3
|
+
Version: 3.6.post4
|
|
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
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class Camera:
|
|
2
|
+
def __init__(self, target, speed=0.1):
|
|
3
|
+
self.target = target # sprite or obj w/ x,y
|
|
4
|
+
self.offset_x = 0
|
|
5
|
+
self.offset_y = 0
|
|
6
|
+
self.speed = speed # smoothness
|
|
7
|
+
|
|
8
|
+
def update(self, win_width, win_height):
|
|
9
|
+
# camera aims for target center
|
|
10
|
+
target_x = self.target.x - win_width // 2
|
|
11
|
+
target_y = self.target.y - win_height // 2
|
|
12
|
+
|
|
13
|
+
# smooth lerp follow
|
|
14
|
+
self.offset_x += (target_x - self.offset_x) * self.speed
|
|
15
|
+
self.offset_y += (target_y - self.offset_y) * self.speed
|
|
16
|
+
|
|
17
|
+
def apply(self, obj):
|
|
18
|
+
# shift object's draw position by camera offset
|
|
19
|
+
return obj.x - self.offset_x, obj.y - self.offset_y
|
|
@@ -39,12 +39,17 @@ class Sprite:
|
|
|
39
39
|
return cls(pos, size=(w, h), color=color)
|
|
40
40
|
|
|
41
41
|
# === METHODS ===
|
|
42
|
-
def draw(self, win):
|
|
42
|
+
def draw(self, win, cam=None):
|
|
43
43
|
"""Draw sprite on a CrystalWindow or Tkinter canvas"""
|
|
44
|
+
if cam:
|
|
45
|
+
draw_x, draw_y = cam.apply(self)
|
|
46
|
+
else:
|
|
47
|
+
draw_x, draw_y = self.x, self.y
|
|
48
|
+
|
|
44
49
|
if self.image:
|
|
45
|
-
win.canvas.create_image(
|
|
50
|
+
win.canvas.create_image(draw_x, draw_y, anchor="nw", image=self.image)
|
|
46
51
|
else:
|
|
47
|
-
win.draw_rect(self.color, (
|
|
52
|
+
win.draw_rect(self.color, (draw_x, draw_y, self.width, self.height))
|
|
48
53
|
|
|
49
54
|
def move(self, dx, dy):
|
|
50
55
|
"""Move sprite by dx/dy"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crystalwindow
|
|
3
|
-
Version: 3.6.
|
|
3
|
+
Version: 3.6.post4
|
|
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
|
|
@@ -7,7 +7,7 @@ with open("README.md", encoding="utf-8") as f:
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name="crystalwindow",
|
|
10
|
-
version="3.6.
|
|
10
|
+
version="3.6.post4", # Force metadata refresh
|
|
11
11
|
packages=find_packages(include=["crystalwindow", "crystalwindow.*"]),
|
|
12
12
|
|
|
13
13
|
include_package_data=True, # include package_data files
|
|
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
|
|
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
|
{crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow/gametests/windowtesting.py
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
|
{crystalwindow-3.6.post3 → crystalwindow-3.6.post4}/crystalwindow.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|