batframework 0.1.2__tar.gz → 0.1.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.
- {batframework-0.1.2 → batframework-0.1.4}/PKG-INFO +1 -1
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/game_manager.py +3 -2
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/lib.py +15 -5
- {batframework-0.1.2 → batframework-0.1.4}/pyproject.toml +1 -1
- {batframework-0.1.2 → batframework-0.1.4}/setup.py +2 -2
- batframework-0.1.2/batFramework/data/font.ttf +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/README.md +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/__init__.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/anchor.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/animated_sprite.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/button.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/camera.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/color.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/constants.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/dialog.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/entitiy.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/gui_container.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/interactive_entity.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/label.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/render_surface.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/scene.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/scene_manager.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/toggle.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/transition.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/tree_container.py +0 -0
- {batframework-0.1.2 → batframework-0.1.4}/batFramework/trigger.py +0 -0
@@ -6,9 +6,10 @@ from .scene_manager import SceneManager
|
|
6
6
|
|
7
7
|
|
8
8
|
class GameManager:
|
9
|
-
def __init__(self, resolution : tuple[int], fps : int, *flags : int):
|
9
|
+
def __init__(self, resolution : tuple[int], fps : int, *flags : int,font_path:str=None,font_size:int=18):
|
10
10
|
pygame.init()
|
11
|
-
|
11
|
+
if font_path :
|
12
|
+
lib.set_font(font_path,font_size)
|
12
13
|
|
13
14
|
pygame.display.set_mode(resolution, *flags)
|
14
15
|
|
@@ -3,14 +3,21 @@ import os
|
|
3
3
|
|
4
4
|
#font_path = "data/font.ttf"
|
5
5
|
BASE_FONT: pygame.font.Font = None
|
6
|
-
ASSETSCALE =
|
6
|
+
ASSETSCALE = 1
|
7
7
|
|
8
8
|
pygame.font.init()
|
9
9
|
try:
|
10
|
-
BASE_FONT = pygame.font.SysFont(size = 18)
|
10
|
+
BASE_FONT = pygame.font.SysFont(name="Corbel",size = 18)
|
11
11
|
except Exception as e:
|
12
12
|
print("Error in init_font:", e)
|
13
13
|
|
14
|
+
def set_font(path:str,size:int=18):
|
15
|
+
global BASE_FONT
|
16
|
+
try:
|
17
|
+
BASE_FONT = pygame.font.Font(path,size)
|
18
|
+
except Exception as e:
|
19
|
+
print("Error in init_font:", e)
|
20
|
+
|
14
21
|
def slicer(path, width, height) -> list[pygame.Surface]:
|
15
22
|
absPath = os.path.abspath(path)
|
16
23
|
surf = pygame.image.load(absPath).convert_alpha()
|
@@ -22,7 +29,10 @@ def slicer(path, width, height) -> list[pygame.Surface]:
|
|
22
29
|
sub = pygame.Surface.subsurface(
|
23
30
|
surf, [x * width, y * height, width, height]
|
24
31
|
).copy()
|
25
|
-
|
26
|
-
|
27
|
-
|
32
|
+
if ASSETSCALE != 1:
|
33
|
+
res.append(
|
34
|
+
pygame.transform.scale(sub, (width * ASSETSCALE, height * ASSETSCALE))
|
35
|
+
)
|
36
|
+
else:
|
37
|
+
res.append(sub)
|
28
38
|
return res
|
@@ -5,14 +5,14 @@ packages = \
|
|
5
5
|
['batframework']
|
6
6
|
|
7
7
|
package_data = \
|
8
|
-
{'': ['*']
|
8
|
+
{'': ['*']}
|
9
9
|
|
10
10
|
install_requires = \
|
11
11
|
['pygame>=2.1.2,<3.0.0']
|
12
12
|
|
13
13
|
setup_kwargs = {
|
14
14
|
'name': 'batframework',
|
15
|
-
'version': '0.1.
|
15
|
+
'version': '0.1.4',
|
16
16
|
'description': 'A pygame framework for making games easier',
|
17
17
|
'long_description': '# Example Package\n\nPygame framework for making games easier.\n',
|
18
18
|
'author': 'Baturay',
|
Binary file
|
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
|