batframework 1.0.8a8__py3-none-any.whl → 1.0.8a10__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.
Files changed (70) hide show
  1. batFramework/__init__.py +68 -51
  2. batFramework/action.py +126 -99
  3. batFramework/actionContainer.py +53 -9
  4. batFramework/animatedSprite.py +141 -82
  5. batFramework/audioManager.py +69 -26
  6. batFramework/camera.py +259 -69
  7. batFramework/character.py +27 -0
  8. batFramework/constants.py +16 -54
  9. batFramework/cutscene.py +39 -29
  10. batFramework/cutsceneBlocks.py +36 -43
  11. batFramework/dynamicEntity.py +18 -9
  12. batFramework/easingController.py +58 -0
  13. batFramework/entity.py +48 -97
  14. batFramework/enums.py +113 -0
  15. batFramework/fontManager.py +65 -0
  16. batFramework/gui/__init__.py +10 -2
  17. batFramework/gui/button.py +9 -78
  18. batFramework/gui/clickableWidget.py +220 -0
  19. batFramework/gui/constraints/__init__.py +1 -0
  20. batFramework/gui/constraints/constraints.py +815 -0
  21. batFramework/gui/container.py +174 -32
  22. batFramework/gui/debugger.py +131 -43
  23. batFramework/gui/dialogueBox.py +99 -0
  24. batFramework/gui/draggableWidget.py +40 -0
  25. batFramework/gui/image.py +56 -20
  26. batFramework/gui/indicator.py +38 -21
  27. batFramework/gui/interactiveWidget.py +192 -13
  28. batFramework/gui/label.py +309 -74
  29. batFramework/gui/layout.py +231 -63
  30. batFramework/gui/meter.py +74 -0
  31. batFramework/gui/radioButton.py +84 -0
  32. batFramework/gui/root.py +134 -38
  33. batFramework/gui/shape.py +237 -57
  34. batFramework/gui/slider.py +240 -0
  35. batFramework/gui/style.py +10 -0
  36. batFramework/gui/styleManager.py +48 -0
  37. batFramework/gui/textInput.py +247 -0
  38. batFramework/gui/toggle.py +101 -51
  39. batFramework/gui/widget.py +358 -250
  40. batFramework/manager.py +52 -19
  41. batFramework/object.py +123 -0
  42. batFramework/particle.py +115 -0
  43. batFramework/renderGroup.py +67 -0
  44. batFramework/resourceManager.py +100 -0
  45. batFramework/scene.py +281 -123
  46. batFramework/sceneManager.py +178 -116
  47. batFramework/scrollingSprite.py +114 -0
  48. batFramework/sprite.py +51 -0
  49. batFramework/stateMachine.py +11 -8
  50. batFramework/templates/__init__.py +2 -0
  51. batFramework/templates/character.py +44 -0
  52. batFramework/templates/states.py +166 -0
  53. batFramework/tileset.py +46 -0
  54. batFramework/time.py +145 -58
  55. batFramework/transition.py +195 -124
  56. batFramework/triggerZone.py +1 -1
  57. batFramework/utils.py +112 -147
  58. batframework-1.0.8a10.dist-info/LICENCE +21 -0
  59. batframework-1.0.8a10.dist-info/METADATA +43 -0
  60. batframework-1.0.8a10.dist-info/RECORD +62 -0
  61. batFramework/debugger.py +0 -48
  62. batFramework/easing.py +0 -71
  63. batFramework/gui/constraints.py +0 -204
  64. batFramework/gui/frame.py +0 -19
  65. batFramework/particles.py +0 -77
  66. batFramework/transitionManager.py +0 -0
  67. batframework-1.0.8a8.dist-info/METADATA +0 -53
  68. batframework-1.0.8a8.dist-info/RECORD +0 -42
  69. {batframework-1.0.8a8.dist-info → batframework-1.0.8a10.dist-info}/WHEEL +0 -0
  70. {batframework-1.0.8a8.dist-info → batframework-1.0.8a10.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,7 @@
1
1
  import batFramework as bf
2
- from .cutscene import Cutscene,CutsceneManager
3
-
2
+ from .cutscene import Cutscene, CutsceneManager
3
+ from .transition import *
4
+ from typing import Optional,Callable
4
5
 
5
6
  # Define the base CutsceneBlock class
6
7
  class CutsceneBlock:
@@ -17,18 +18,18 @@ class CutsceneBlock:
17
18
  self.ended = False
18
19
  self.started = False
19
20
 
20
- def get_scene_at(self,index):
21
- return bf.CutsceneManager().manager._scenes[index]
21
+ def get_scene_at(self, index):
22
+ return bf.CutsceneManager().manager.scenes[index]
23
+
24
+ def set_scene(self, name, index=0):
25
+ return CutsceneManager().manager.set_scene(name, index)
22
26
 
23
- def set_scene(self,name,index=0):
24
- return CutsceneManager().manager.set_scene(name,index)
25
-
26
27
  def get_current_scene(self):
27
28
  return CutsceneManager().manager.get_current_scene()
28
-
29
- def get_scene(self,name):
29
+
30
+ def get_scene(self, name):
30
31
  return CutsceneManager().manager.get_scene(name)
31
-
32
+
32
33
  # Set the parent cutscene for this block
33
34
  def set_parent_cutscene(self, parent):
34
35
  """
@@ -90,17 +91,13 @@ class ParallelBlock(CutsceneBlock):
90
91
  Represents a parallel execution block for multiple Cutscene blocks.
91
92
  """
92
93
 
93
- # Constructor for ParallelBlock, taking a variable number of blocks as arguments
94
94
  def __init__(self, *blocks) -> None:
95
95
  super().__init__()
96
96
  # List of blocks to run in parallel
97
- self.blocks: list[CutsceneBlock] = blocks
97
+ self.blocks: list[CutsceneBlock] = list(blocks)
98
98
 
99
99
  # Start the parallel block (override the base class method)
100
100
  def start(self):
101
- """
102
- Start the parallel execution block.
103
- """
104
101
  super().start()
105
102
  # Start each block in parallel
106
103
  for block in self.blocks:
@@ -108,32 +105,14 @@ class ParallelBlock(CutsceneBlock):
108
105
 
109
106
  # Process an event for each block in parallel
110
107
  def process_event(self, event):
111
- """
112
- Process an event for each block in the parallel execution block.
113
-
114
- Args:
115
- event: The event to be processed.
116
- """
117
108
  _ = [b.process_event(event) for b in self.blocks]
118
109
 
119
110
  # Update each block in parallel
120
111
  def update(self, dt):
121
- """
122
- Update each block in the parallel execution block.
123
-
124
- Args:
125
- dt: Time elapsed since the last update.
126
- """
127
112
  _ = [b.update(dt) for b in self.blocks]
128
113
 
129
114
  # Check if all blocks have ended
130
115
  def has_ended(self):
131
- """
132
- Check if all blocks in the parallel execution block have ended.
133
-
134
- Returns:
135
- bool: True if all blocks have ended, False otherwise.
136
- """
137
116
  return all(b.has_ended() for b in self.blocks)
138
117
 
139
118
 
@@ -144,15 +123,16 @@ class SceneTransitionBlock(CutsceneBlock):
144
123
  """
145
124
 
146
125
  # Constructor for SceneTransitionBlock
147
- def __init__(self, scene, transition, duration, **kwargs) -> None:
126
+ def __init__(
127
+ self, scene, transition: Transition = Fade(0.1), index: int = 0
128
+ ) -> None:
148
129
  super().__init__()
149
130
  # Target scene, transition type, duration, and additional keyword arguments
150
131
  self.target_scene = scene
151
132
  self.transition = transition
152
- self.duration = duration
153
- self.kwargs = kwargs
133
+ self.index = index
154
134
  # Timer to handle the end of the transition
155
- self.timer = bf.Timer(name = "scene_transition_block",duration=duration, end_callback=self.end)
135
+ self.timer = bf.Timer(transition.duration, self.end)
156
136
 
157
137
  # Start the scene transition block
158
138
  def start(self):
@@ -160,17 +140,30 @@ class SceneTransitionBlock(CutsceneBlock):
160
140
  Start the scene transition block.
161
141
  """
162
142
  super().start()
163
- print(f"transition to {scene}")
164
-
165
143
  # Initiate the scene transition
166
- if self.get_current_scene()._name == self.target_scene:
144
+ if self.get_current_scene().name == self.target_scene:
167
145
  self.end()
168
146
  return
169
147
  CutsceneManager().manager.transition_to_scene(
170
- self.target_scene, self.transition, duration=self.duration, **self.kwargs
148
+ self.target_scene, self.transition, self.index
171
149
  )
172
150
  # Start the timer to handle the end of the transition
173
151
  self.timer.start()
174
152
 
175
- def end(self):
176
- return super().end()
153
+ class DelayBlock(CutsceneBlock):
154
+ def __init__(self, duration) -> None:
155
+ super().__init__()
156
+ self.timer = bf.Timer(duration=duration, end_callback=self.end)
157
+
158
+ def start(self):
159
+ super().start()
160
+ self.timer.start()
161
+
162
+ class FunctionBlock(CutsceneBlock):
163
+ def __init__(self, func : Optional[Callable]) -> None:
164
+ self.function = func
165
+
166
+ def start(self):
167
+ super().start()
168
+ if self.function : self.function()
169
+ self.end()
@@ -2,22 +2,31 @@ import pygame
2
2
  import batFramework as bf
3
3
  from typing import Self
4
4
 
5
+
5
6
  class DynamicEntity(bf.Entity):
6
7
  def __init__(
7
8
  self,
8
- size : None|tuple[int,int]=None,
9
- no_surface : bool =False,
10
- surface_flags : int =0,
11
- convert_alpha : bool=False
9
+ size: None | tuple[int, int] = None,
10
+ surface_flags: int = 0,
11
+ convert_alpha: bool = False,*args,**kwargs
12
12
  ) -> None:
13
- super().__init__(size,no_surface,surface_flags,convert_alpha)
13
+ super().__init__(size, surface_flags, convert_alpha,*args,**kwargs)
14
14
  self.velocity = pygame.math.Vector2(0, 0)
15
+ self.ignore_collisions : bool = False
15
16
 
16
- def on_collideX(self, collider: Self):
17
+ def on_collideX(self, collider: "DynamicEntity"):
18
+ """
19
+ Return true if collision
20
+ """
17
21
  return False
18
22
 
19
- def on_collideY(self, collider: Self):
23
+ def on_collideY(self, collider: "DynamicEntity"):
24
+ """
25
+ Return true if collision
26
+ """
20
27
  return False
21
28
 
22
- def move_by_velocity(self)->None:
23
- self.set_position(self.rect.x + self.velocity.x, self.rect.y + self.velocity.y)
29
+ def move_by_velocity(self, dt) -> None:
30
+ self.set_position(
31
+ self.rect.x + self.velocity.x * dt, self.rect.y + self.velocity.y * dt
32
+ )
@@ -0,0 +1,58 @@
1
+ import pygame
2
+ import batFramework as bf
3
+ from functools import lru_cache
4
+ from .enums import easing
5
+
6
+
7
+ @lru_cache(maxsize=None)
8
+ def process_value(progress: float, p0: float, p1: float, p2: float, p3: float) -> float:
9
+ if p0 == 0 and p1 == 0 and p2 == 1 and p3 == 1: # Linear easing control points
10
+ return progress
11
+ t = progress
12
+ t_inv = 1.0 - t
13
+ t2 = t * t
14
+ t3 = t * t2
15
+ t_inv2 = t_inv * t_inv
16
+ return 3 * t_inv2 * t * p1 + 3 * t_inv * t2 * p3 + t3
17
+
18
+
19
+ class EasingController(bf.Timer):
20
+ def __init__(
21
+ self,
22
+ easing_function: easing = easing.LINEAR,
23
+ duration: float = 1,
24
+ update_callback=None,
25
+ end_callback=None,
26
+ loop: bool = False,
27
+ ) -> None:
28
+ self.easing_function = easing_function
29
+ self.update_callback = update_callback
30
+ self.value: float = 0.0
31
+ super().__init__(duration, end_callback, loop)
32
+
33
+ def get_value(self) -> float:
34
+ return self.value
35
+
36
+ def start(self, force: bool = False):
37
+ super().start(force)
38
+ self.value = 0
39
+
40
+ def update(self, dt: float) -> None:
41
+ if self.get_progression() == 1:
42
+ return
43
+ super().update(dt)
44
+ if self.get_progression() == 0:
45
+ return
46
+ if self.easing_function == easing.LINEAR:
47
+ self.value = self.get_progression()
48
+ else:
49
+ self.value = process_value(
50
+ self.get_progression(), *self.easing_function.control_points
51
+ )
52
+ if self.update_callback:
53
+ self.update_callback(self.value)
54
+
55
+ def end(self):
56
+ if self.update_callback:
57
+ self.update_callback(1)
58
+ super().end()
batFramework/entity.py CHANGED
@@ -1,123 +1,74 @@
1
+ from typing import Any, Self
1
2
  import pygame
2
3
  import batFramework as bf
3
- from typing import Any
4
+ from .object import Object
5
+
6
+
7
+ class Entity(Object):
8
+ """
9
+ Basic entity class
10
+ """
4
11
 
5
- class Entity:
6
- instance_num = 0
7
12
  def __init__(
8
13
  self,
9
- size : None|tuple[int,int]=None,
10
- no_surface : bool =False,
11
- surface_flags : int =0,
12
- convert_alpha : bool=False
14
+ size: None | tuple[int, int] = None,
15
+ surface_flags: int = 0,
16
+ convert_alpha: bool = False,
17
+ *args,
18
+ **kwargs,
13
19
  ) -> None:
14
- self.convert_alpha = convert_alpha
15
- if size is None:
16
- size= (100,100)
17
-
18
- if no_surface:
19
- self.surface = None
20
- else:
21
- self.surface = (pygame.Surface(size, surface_flags))
22
-
23
- if convert_alpha and self.surface is not None:
20
+ super().__init__()
21
+ self.visible: bool = True
22
+ self.rect.size = (10, 10) if size is None else size
23
+ self.convert_alpha: bool = convert_alpha
24
+ self.surface_flags: int = surface_flags
25
+ self.blit_flags: int = 0
26
+ self.surface: pygame.Surface = pygame.Surface(self.rect.size, surface_flags)
27
+ if convert_alpha:
24
28
  self.surface = self.surface.convert_alpha()
25
- self.surface.fill((0,0,0,0))
26
-
27
- self.uid: Any = Entity.instance_num
28
- self.tags: list[str] = []
29
- self.parent_scene: bf.Scene | None = None
30
- self.rect = pygame.FRect(0, 0, *size)
31
-
32
- self.visible = True
33
- self._debug_color : tuple = bf.color.DARK_RED
34
- self.render_order = 0
35
- self.z_depth = 1
36
- Entity.instance_num += 1
37
-
38
- def get_bounding_box(self):
39
- yield (self.rect,self._debug_color)
29
+ self.surface.fill((0, 0, 0, 0))
40
30
 
41
- def set_debug_color(self, color):
42
- self._debug_color = color
43
-
44
- def set_visible(self, value: bool):
45
- self.visible = value
46
-
47
- def set_parent_scene(self, scene):
48
- self.parent_scene = scene
49
-
50
- def do_when_added(self):
51
- pass
31
+ def set_alpha(self, alpha: int) -> Self:
32
+ self.surface.set_alpha(min(max(0, alpha), 255))
33
+ return self
52
34
 
53
- def do_when_removed(self):
54
- pass
35
+ def get_alpha(self) -> int:
36
+ return self.surface.get_alpha()
55
37
 
56
- def set_position(self, x, y):
57
- self.rect.topleft = (x, y)
38
+ def set_surface_flags(self, surface_flags: int) -> Self:
39
+ self.surface_flags = surface_flags
58
40
  return self
59
41
 
60
- def set_x(self,x):
61
- self.rect.x = x
42
+ def set_convert_alpha(self, value: bool) -> Self:
43
+ self.convert_alpha = value
62
44
  return self
63
45
 
64
- def set_y(self,y):
65
- self.rect.y = y
46
+ def set_blit_flags(self, blit_flags: int) -> Self:
47
+ self.blit_flags = blit_flags
66
48
  return self
67
49
 
68
- def set_center(self, x, y):
69
- self.rect.center = (x, y)
70
- return self
50
+ def get_debug_outlines(self):
51
+ if self.visible:
52
+ yield (self.rect, self.debug_color)
71
53
 
72
- def set_uid(self, uid):
73
- self.uid = uid
54
+ def set_render_order(self, render_order: int) -> Self:
55
+ self.render_order = render_order
56
+ if self.parent_scene:
57
+ self.parent_scene.sort_entities()
74
58
  return self
75
59
 
76
- def add_tag(self, *tags):
77
- for tag in tags:
78
- if tag not in self.tags:
79
- self.tags.append(tag)
80
- self.tags.sort()
60
+ def set_visible(self, value: bool) -> Self:
61
+ self.visible = value
81
62
  return self
82
63
 
83
- def remove_tag(self, *tags):
84
- self.tags = [tag for tag in self.tags if tag not in tags]
85
- self.tags.sort()
86
-
87
- def has_tag(self, tag) -> bool:
88
- return tag in self.tags
89
-
90
- def process_event(self, event: pygame.Event)->bool:
64
+ def draw(self, camera: bf.Camera) -> None:
91
65
  """
92
- Returns bool : True if the method is blocking (no propagation to next children of the scene)
66
+ Draw the entity onto the camera surface
93
67
  """
94
- self.do_process_actions(event)
95
- res = self.do_handle_event(event)
96
- self.do_reset_actions()
97
- return res
98
-
99
- def do_process_actions(self,event : pygame.Event)->None:
100
- pass
101
-
102
- def do_reset_actions(self)->None:
103
- pass
104
-
105
- def do_handle_event(self, event: pygame.Event) -> bool:
106
- return False
107
-
108
- def update(self, dt: float):
109
- self.do_update(dt)
110
-
111
- def do_update(self,dt:float):
112
- pass
113
-
114
- def draw(self, camera: bf.Camera) -> int:
115
- if not self.visible:
116
- return False
117
- if not self.surface or not camera.intersects(self.rect):
118
- return False
68
+ if not self.visible or not camera.rect.colliderect(self.rect):
69
+ return
119
70
  camera.surface.blit(
120
71
  self.surface,
121
- tuple(round(i * self.z_depth) for i in camera.transpose(self.rect).topleft),
72
+ camera.world_to_screen(self.rect),
73
+ special_flags=self.blit_flags,
122
74
  )
123
- return True
batFramework/enums.py ADDED
@@ -0,0 +1,113 @@
1
+ from enum import Enum
2
+
3
+
4
+ class color:
5
+ WHITE = (255, 255, 255)
6
+ LIGHTER_GRAY = (236, 240, 241)
7
+ LIGHT_GRAY = (189, 195, 199)
8
+ DARK_GRAY = (66, 66, 66)
9
+ DARKER_GRAY = (23, 23, 23)
10
+ BLACK = (0, 0, 0)
11
+
12
+ TURQUOISE = (26, 188, 156)
13
+ TURQUOISE_SHADE = (22, 160, 133)
14
+
15
+ GREEN = (46, 204, 113)
16
+ GREEN_SHADE = (39, 174, 96)
17
+
18
+ BLUE = (52, 152, 219)
19
+ BLUE_SHADE = (41, 128, 185)
20
+
21
+ PURPLE = (155, 89, 182)
22
+ PURPLE_SHADE = (142, 68, 173)
23
+
24
+ CHARCOAL = (52, 73, 94)
25
+ CHARCOAL_SHADE = (44, 62, 80)
26
+
27
+ GOLD = (241, 196, 15)
28
+ GOLD_SHADE = (243, 156, 18)
29
+
30
+ ORANGE = (230, 126, 34)
31
+ ORANGE_SHADE = (211, 84, 0)
32
+
33
+ RED = (231, 76, 60)
34
+ RED_SHADE = (192, 57, 43)
35
+
36
+ CLOUD = (236, 240, 241)
37
+ CLOUD_SHADE = (189, 195, 199)
38
+
39
+ CONCRETE = (149, 165, 166)
40
+ CONCRETE_SHADE = (127, 140, 141)
41
+
42
+ # GB
43
+ DARKER_GB = (27, 42, 9)
44
+ DARK_GB = (14, 69, 11)
45
+ LIGHT_GB = (73, 107, 34)
46
+ LIGHTER_GB = (154, 158, 63)
47
+
48
+
49
+ class easing(Enum):
50
+ LINEAR = (0, 0, 1, 1)
51
+ EASE_IN = (0.95, 0, 1, 0.55)
52
+ EASE_OUT = (0.5, 1, 0.5, 1)
53
+ EASE_IN_OUT = (0.55, 0, 0.45, 1)
54
+ EASE_IN_OUT_ELASTIC = (0.76,-0.36,0.41,1.34)
55
+
56
+ def __init__(self, *control_points):
57
+ self.control_points = control_points
58
+
59
+
60
+ class axis(Enum):
61
+ HORIZONTAL = "horizontal"
62
+ VERTICAL = "vertical"
63
+
64
+
65
+ class spacing(Enum):
66
+ MIN = "min"
67
+ HALF = "half"
68
+ MAX = "max"
69
+ MANUAL = "manual"
70
+
71
+
72
+ class alignment(Enum):
73
+ LEFT = "left"
74
+ RIGHT = "right"
75
+ CENTER = "center"
76
+ TOP = "top"
77
+ BOTTOM = "bottom"
78
+ TOPLEFT = "topleft"
79
+ TOPRIGHT = "topright"
80
+ MIDLEFT = "midleft"
81
+ MIDRIGHT = "midright"
82
+ BOTTOMLEFT = "bottomleft"
83
+ BOTTOMRIGHT = "bottomright"
84
+
85
+
86
+ class direction(Enum):
87
+ LEFT = 0
88
+ UP = 1
89
+ RIGHT = 2
90
+ DOWN = 3
91
+
92
+
93
+ class drawMode(Enum):
94
+ SOLID = 0
95
+ TEXTURED = 1
96
+
97
+
98
+ class debugMode(Enum):
99
+ HIDDEN = 0
100
+ DEBUGGER = 1
101
+ OUTLINES = 2
102
+
103
+
104
+ class actionType(Enum):
105
+ INSTANTANEOUS = 0
106
+ CONTINUOUS = 1
107
+ HOLDING = 2
108
+
109
+
110
+ class textMode(Enum):
111
+ ALPHABETICAL = 0
112
+ NUMERICAL = 1
113
+ ALPHANUMERICAL = 3
@@ -0,0 +1,65 @@
1
+ from .utils import Singleton
2
+
3
+ # put font stuff here later
4
+ import pygame
5
+ import os
6
+ import batFramework as bf
7
+
8
+
9
+ class FontManager(metaclass=Singleton):
10
+ def __init__(self):
11
+ pygame.font.init()
12
+ self.DEFAULT_TEXT_SIZE = 16
13
+ self.MIN_FONT_SIZE = 8
14
+ self.MAX_FONT_SIZE = 64
15
+ self.DEFAULT_ANTIALIAS = False
16
+ self.FONTS = {}
17
+
18
+ def set_antialias(self, value: bool):
19
+ self.DEFAULT_ANTIALIAS = value
20
+
21
+ def set_default_text_size(self, size: int):
22
+ self.DEFAULT_TEXT_SIZE = size
23
+
24
+ def init_font(self, raw_path: str | None):
25
+ try:
26
+ if raw_path is not None:
27
+ self.load_font(raw_path if raw_path else None, None)
28
+ self.load_font(raw_path)
29
+ except FileNotFoundError:
30
+ self.load_sysfont(raw_path)
31
+ self.load_sysfont(raw_path, None)
32
+
33
+ def load_font(self, path: str | None, name: str | None = ""):
34
+ if path is not None:
35
+ path = bf.ResourceManager().get_path(path) # convert path if given
36
+ filename = None
37
+ if path is not None:
38
+ filename = os.path.basename(path).split(".")[0]
39
+
40
+ # get filename if path is given, else None
41
+ if name != "":
42
+ filename = name # if name is not given, name is the filename
43
+ self.FONTS[filename] = {}
44
+ # fill the dict
45
+ for size in range(self.MIN_FONT_SIZE, self.MAX_FONT_SIZE+1, 2):
46
+ self.FONTS[filename][size] = pygame.font.Font(path, size=size)
47
+
48
+ def load_sysfont(self, font_name: str | None, key: str | None = ""):
49
+ if key == "":
50
+ key = font_name
51
+ if font_name is None or pygame.font.match_font(font_name) is None:
52
+ raise FileNotFoundError(f"Requested font '{font_name}' was not found")
53
+ self.FONTS[font_name] = {}
54
+
55
+ for size in range(self.MIN_FONT_SIZE, self.MAX_FONT_SIZE+1, 2):
56
+ self.FONTS[key][size] = pygame.font.SysFont(font_name, size=size)
57
+
58
+ def get_font(
59
+ self, name: str | None = None, text_size: int = 12
60
+ ) -> pygame.Font | None:
61
+ if not name in self.FONTS:
62
+ return None
63
+ if not text_size in self.FONTS[name]:
64
+ return None
65
+ return self.FONTS[name][text_size]
@@ -1,14 +1,22 @@
1
1
  from .constraints import *
2
2
  from .widget import Widget
3
+ from .styleManager import StyleManager
4
+ from .style import Style
3
5
  from .image import Image
4
6
  from .interactiveWidget import InteractiveWidget
7
+ from .draggableWidget import DraggableWidget
8
+ from .clickableWidget import ClickableWidget
5
9
  from .root import Root
6
10
  from .shape import Shape
7
- from .frame import Frame
11
+ from .meter import Meter
8
12
  from .label import Label
13
+ from .dialogueBox import DialogueBox
14
+ from .textInput import TextInput
9
15
  from .button import Button
10
- from .debugger import Debugger
16
+ from .debugger import *
11
17
  from .layout import *
12
18
  from .container import Container
13
19
  from .indicator import *
14
20
  from .toggle import Toggle
21
+ from .radioButton import RadioButton, RadioVariable
22
+ from .slider import Slider