PygameToolsKit 1.1.3__tar.gz → 1.2.4__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.
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PKG-INFO +1 -1
- pygametoolskit-1.2.4/PygameToolsKit/Animation/animation.py +30 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit.egg-info/PKG-INFO +1 -1
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit.egg-info/SOURCES.txt +1 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/pyproject.toml +1 -1
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Decorators/onJoystick.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Decorators/onKey.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Decorators/timer.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Event/eventListener.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Event/eventManager.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Event/eventObject.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Event/isEventObject.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Graphics/color.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Inputs/dir.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Inputs/joystickManager.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Inputs/keyManager.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Update/update.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/Update/updateManager.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit/__init__.py +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit.egg-info/dependency_links.txt +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit.egg-info/requires.txt +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/PygameToolsKit.egg-info/top_level.txt +0 -0
- {pygametoolskit-1.1.3 → pygametoolskit-1.2.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PygameToolsKit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Bibliothèque qui dispose de divers classes, fonctions et décorateurs pour aider au développement avec pygame
|
|
5
5
|
Requires-Dist: DecoratorsToolKit>=1.0.0
|
|
6
6
|
Requires-Dist: pygame-ce>=2.5.0
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import pygame
|
|
2
|
+
|
|
3
|
+
from ..Update.update import Update
|
|
4
|
+
|
|
5
|
+
class Animation:
|
|
6
|
+
|
|
7
|
+
def __init__(self, frames: list[pygame.Surface], frame_duration: float):
|
|
8
|
+
self.frames = frames
|
|
9
|
+
self.now = pygame.time.get_ticks()
|
|
10
|
+
|
|
11
|
+
self.index = 0
|
|
12
|
+
|
|
13
|
+
self.current_frame = self.frames[self.index]
|
|
14
|
+
|
|
15
|
+
self.frames_duration = frame_duration
|
|
16
|
+
|
|
17
|
+
self.start = False
|
|
18
|
+
|
|
19
|
+
def start_animation(self):
|
|
20
|
+
self.start = True
|
|
21
|
+
|
|
22
|
+
@Update()
|
|
23
|
+
def play(self) -> pygame.Surface:
|
|
24
|
+
if self.start:
|
|
25
|
+
if pygame.time.get_ticks() - self.now >= self.frames_duration * 1000:
|
|
26
|
+
self.now = pygame.time.get_ticks()
|
|
27
|
+
self.index = (self.index + 1) % len(self.frames)
|
|
28
|
+
self.current_frame = self.frames[self.index]
|
|
29
|
+
|
|
30
|
+
return self.current_frame
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PygameToolsKit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Bibliothèque qui dispose de divers classes, fonctions et décorateurs pour aider au développement avec pygame
|
|
5
5
|
Requires-Dist: DecoratorsToolKit>=1.0.0
|
|
6
6
|
Requires-Dist: pygame-ce>=2.5.0
|
|
@@ -5,6 +5,7 @@ PygameToolsKit.egg-info/SOURCES.txt
|
|
|
5
5
|
PygameToolsKit.egg-info/dependency_links.txt
|
|
6
6
|
PygameToolsKit.egg-info/requires.txt
|
|
7
7
|
PygameToolsKit.egg-info/top_level.txt
|
|
8
|
+
PygameToolsKit/Animation/animation.py
|
|
8
9
|
PygameToolsKit/Decorators/onJoystick.py
|
|
9
10
|
PygameToolsKit/Decorators/onKey.py
|
|
10
11
|
PygameToolsKit/Decorators/timer.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PygameToolsKit"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.2.4"
|
|
8
8
|
description = "Bibliothèque qui dispose de divers classes, fonctions et décorateurs pour aider au développement avec pygame"
|
|
9
9
|
|
|
10
10
|
dependencies = [
|
|
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
|