mini-arcade-core 0.6.1__py3-none-any.whl → 0.7.0__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.
@@ -57,6 +57,11 @@ class Backend(Protocol):
57
57
  Concrete backends will translate their native events into core Event objects.
58
58
  """
59
59
 
60
+ def set_clear_color(self, r: int, g: int, b: int) -> None:
61
+ """
62
+ Set the background/clear color used by begin_frame.
63
+ """
64
+
60
65
  def begin_frame(self) -> None:
61
66
  """
62
67
  Prepare for drawing a new frame (e.g. clear screen).
@@ -67,9 +72,34 @@ class Backend(Protocol):
67
72
  Present the frame to the user (swap buffers).
68
73
  """
69
74
 
70
- def draw_rect(self, x: int, y: int, w: int, h: int) -> None:
75
+ # Justification: Simple drawing API for now
76
+ # pylint: disable=too-many-arguments,too-many-positional-arguments
77
+ def draw_rect(
78
+ self,
79
+ x: int,
80
+ y: int,
81
+ w: int,
82
+ h: int,
83
+ color: tuple[int, int, int] = (255, 255, 255),
84
+ ) -> None:
71
85
  """
72
86
  Draw a filled rectangle in some default color.
73
87
 
74
88
  We'll keep this minimal for now; later we can extend with colors/sprites.
75
89
  """
90
+
91
+ # pylint: enable=too-many-arguments,too-many-positional-arguments
92
+
93
+ def draw_text(
94
+ self,
95
+ x: int,
96
+ y: int,
97
+ text: str,
98
+ color: tuple[int, int, int] = (255, 255, 255),
99
+ ) -> None:
100
+ """
101
+ Draw text at the given position in a default font and color.
102
+
103
+ Backends may ignore advanced styling for now; this is just to render
104
+ simple labels like menu items, scores, etc.
105
+ """
mini_arcade_core/game.py CHANGED
@@ -32,7 +32,7 @@ class GameConfig:
32
32
  title: str = "Mini Arcade Game"
33
33
  fps: int = 60
34
34
  background_color: tuple[int, int, int] = (0, 0, 0)
35
- backend: type[Backend] | None = None
35
+ backend: Backend | None = None
36
36
 
37
37
 
38
38
  class Game:
@@ -84,6 +84,9 @@ class Game:
84
84
  backend = self.backend
85
85
  backend.init(self.config.width, self.config.height, self.config.title)
86
86
 
87
+ br, bg, bb = self.config.background_color
88
+ backend.set_clear_color(br, bg, bb)
89
+
87
90
  self.change_scene(initial_scene)
88
91
 
89
92
  self._running = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mini-arcade-core
3
- Version: 0.6.1
3
+ Version: 0.7.0
4
4
  Summary: Tiny scene-based game loop core for small arcade games.
5
5
  License: Copyright (c) 2025 Santiago Rincón
6
6
 
@@ -0,0 +1,9 @@
1
+ mini_arcade_core/__init__.py,sha256=0PFa04KRSY3kT8YoD24zfFt92HYfrk6QrH8IlHbmeo4,1753
2
+ mini_arcade_core/backend.py,sha256=Vus-TIU16ySSGKuy1S-sBWkpb2WUZCbUHYBPcwGpW9o,2665
3
+ mini_arcade_core/entity.py,sha256=mAkedH0j14giBQFRpQjaym46uczbQDln6nbxy0WFAqU,1077
4
+ mini_arcade_core/game.py,sha256=G9x5FCzJN0KsnCy063sBgWkr3WkbPOJ8_SOHaslZ1mQ,3369
5
+ mini_arcade_core/scene.py,sha256=FEtywrnOBU8p0-t8oWGDELYBRRXOs4-Phe0dF7iSjKI,927
6
+ mini_arcade_core-0.7.0.dist-info/METADATA,sha256=wRO23CTApLzioWwh50uJQPU823HRURJCRLueAabity0,8296
7
+ mini_arcade_core-0.7.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
8
+ mini_arcade_core-0.7.0.dist-info/licenses/LICENSE,sha256=3lHAuV0584cVS5vAqi2uC6GcsVgxUijvwvtZckyvaZ4,1096
9
+ mini_arcade_core-0.7.0.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- mini_arcade_core/__init__.py,sha256=0PFa04KRSY3kT8YoD24zfFt92HYfrk6QrH8IlHbmeo4,1753
2
- mini_arcade_core/backend.py,sha256=6_3-ni0EQJXfaSReavcrOeUOCNkdrjGctFn5q0D9nrw,1847
3
- mini_arcade_core/entity.py,sha256=mAkedH0j14giBQFRpQjaym46uczbQDln6nbxy0WFAqU,1077
4
- mini_arcade_core/game.py,sha256=5mLbi3IzgfRXBTwl88L-ooez16NtwLKLQZzYvMkLHco,3280
5
- mini_arcade_core/scene.py,sha256=FEtywrnOBU8p0-t8oWGDELYBRRXOs4-Phe0dF7iSjKI,927
6
- mini_arcade_core-0.6.1.dist-info/METADATA,sha256=pXNVRAEdlB52_Vz50sUTIPLoYLjMrPyvLfYFQsDXspw,8296
7
- mini_arcade_core-0.6.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
8
- mini_arcade_core-0.6.1.dist-info/licenses/LICENSE,sha256=3lHAuV0584cVS5vAqi2uC6GcsVgxUijvwvtZckyvaZ4,1096
9
- mini_arcade_core-0.6.1.dist-info/RECORD,,