mini-arcade-core 0.9.8__py3-none-any.whl → 0.10.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.
- mini_arcade_core/__init__.py +24 -37
- mini_arcade_core/bus.py +57 -0
- mini_arcade_core/commands.py +84 -0
- mini_arcade_core/entity.py +3 -2
- mini_arcade_core/game.py +1 -1
- mini_arcade_core/managers/__init__.py +22 -0
- mini_arcade_core/managers/base.py +132 -0
- mini_arcade_core/{cheats.py → managers/cheats.py} +131 -11
- mini_arcade_core/managers/entities.py +38 -0
- mini_arcade_core/managers/inputs.py +282 -0
- mini_arcade_core/managers/overlays.py +53 -0
- mini_arcade_core/managers/system.py +26 -0
- mini_arcade_core/scenes/__init__.py +11 -1
- mini_arcade_core/scenes/model.py +34 -0
- mini_arcade_core/scenes/runtime.py +29 -0
- mini_arcade_core/scenes/scene.py +42 -82
- mini_arcade_core/scenes/system.py +69 -0
- mini_arcade_core/spaces/__init__.py +12 -0
- mini_arcade_core/{two_d → spaces/d2}/kinematics2d.py +3 -0
- mini_arcade_core/ui/__init__.py +13 -1
- mini_arcade_core/ui/menu.py +232 -54
- mini_arcade_core/ui/overlays.py +41 -0
- {mini_arcade_core-0.9.8.dist-info → mini_arcade_core-0.10.0.dist-info}/METADATA +1 -1
- mini_arcade_core-0.10.0.dist-info/RECORD +40 -0
- mini_arcade_core-0.9.8.dist-info/RECORD +0 -27
- /mini_arcade_core/{two_d → spaces/d2}/__init__.py +0 -0
- /mini_arcade_core/{two_d → spaces/d2}/boundaries2d.py +0 -0
- /mini_arcade_core/{two_d → spaces/d2}/collision2d.py +0 -0
- /mini_arcade_core/{two_d → spaces/d2}/geometry2d.py +0 -0
- /mini_arcade_core/{two_d → spaces/d2}/physics2d.py +0 -0
- {mini_arcade_core-0.9.8.dist-info → mini_arcade_core-0.10.0.dist-info}/WHEEL +0 -0
- {mini_arcade_core-0.9.8.dist-info → mini_arcade_core-0.10.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -27,6 +27,7 @@ class KinematicData:
|
|
|
27
27
|
position: Position2D
|
|
28
28
|
size: Size2D
|
|
29
29
|
velocity: Velocity2D
|
|
30
|
+
time_scale: float = 1.0
|
|
30
31
|
color: Optional[Color] = None # future use
|
|
31
32
|
|
|
32
33
|
# Justification: Convenience factory with many params.
|
|
@@ -40,6 +41,7 @@ class KinematicData:
|
|
|
40
41
|
height: int,
|
|
41
42
|
vx: float = 0.0,
|
|
42
43
|
vy: float = 0.0,
|
|
44
|
+
time_scale: float = 1.0,
|
|
43
45
|
color: Optional[Color] = None,
|
|
44
46
|
) -> "KinematicData":
|
|
45
47
|
"""
|
|
@@ -73,6 +75,7 @@ class KinematicData:
|
|
|
73
75
|
position=Position2D(float(x), float(y)),
|
|
74
76
|
size=Size2D(int(width), int(height)),
|
|
75
77
|
velocity=Velocity2D(float(vx), float(vy)),
|
|
78
|
+
time_scale=time_scale,
|
|
76
79
|
color=color,
|
|
77
80
|
)
|
|
78
81
|
|
mini_arcade_core/ui/__init__.py
CHANGED
|
@@ -5,10 +5,22 @@ Includes buttons, labels, and layout management.
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from .menu import
|
|
8
|
+
from .menu import (
|
|
9
|
+
BaseMenuScene,
|
|
10
|
+
Menu,
|
|
11
|
+
MenuItem,
|
|
12
|
+
MenuModel,
|
|
13
|
+
MenuStyle,
|
|
14
|
+
MenuSystem,
|
|
15
|
+
)
|
|
16
|
+
from .overlays import BaseOverlay
|
|
9
17
|
|
|
10
18
|
__all__ = [
|
|
11
19
|
"Menu",
|
|
12
20
|
"MenuItem",
|
|
13
21
|
"MenuStyle",
|
|
22
|
+
"MenuModel",
|
|
23
|
+
"MenuSystem",
|
|
24
|
+
"BaseMenuScene",
|
|
25
|
+
"BaseOverlay",
|
|
14
26
|
]
|
mini_arcade_core/ui/menu.py
CHANGED
|
@@ -5,12 +5,14 @@ Menu system for mini arcade core.
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
7
7
|
from dataclasses import dataclass
|
|
8
|
-
from typing import Callable, Sequence
|
|
8
|
+
from typing import Callable, Optional, Sequence
|
|
9
9
|
|
|
10
10
|
from mini_arcade_core.backend import Backend, Color, Event, EventType
|
|
11
|
-
from mini_arcade_core.
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
from mini_arcade_core.commands import BaseCommand, QuitGameCommand
|
|
12
|
+
from mini_arcade_core.game import Game
|
|
13
|
+
from mini_arcade_core.keymaps import Key
|
|
14
|
+
from mini_arcade_core.scenes import BaseSceneSystem, Scene, SceneModel
|
|
15
|
+
from mini_arcade_core.spaces.d2 import Size2D
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
@dataclass(frozen=True)
|
|
@@ -19,11 +21,25 @@ class MenuItem:
|
|
|
19
21
|
Represents a single item in a menu.
|
|
20
22
|
|
|
21
23
|
:ivar label (str): The text label of the menu item.
|
|
22
|
-
:ivar on_select (
|
|
24
|
+
:ivar on_select (BaseCommand): The action to perform when the item is selected.
|
|
23
25
|
"""
|
|
24
26
|
|
|
27
|
+
id: str
|
|
25
28
|
label: str
|
|
26
|
-
on_select:
|
|
29
|
+
on_select: BaseCommand
|
|
30
|
+
label_fn: Optional[Callable[[Game], str]] = None
|
|
31
|
+
|
|
32
|
+
def resolved_label(self, game: Game) -> str:
|
|
33
|
+
"""
|
|
34
|
+
Get the resolved label for this menu item.
|
|
35
|
+
|
|
36
|
+
:param game: The current game instance.
|
|
37
|
+
:type game: Game
|
|
38
|
+
|
|
39
|
+
:return: The resolved label string.
|
|
40
|
+
:rtype: str
|
|
41
|
+
"""
|
|
42
|
+
return self.label_fn(game) if self.label_fn else self.label
|
|
27
43
|
|
|
28
44
|
|
|
29
45
|
# Justification: Data container for styling options needs
|
|
@@ -104,12 +120,11 @@ class MenuStyle:
|
|
|
104
120
|
item_font_size = 24
|
|
105
121
|
|
|
106
122
|
|
|
107
|
-
# pylint: enable=too-many-instance-attributes
|
|
108
|
-
|
|
109
|
-
|
|
110
123
|
class Menu:
|
|
111
124
|
"""A simple text-based menu system."""
|
|
112
125
|
|
|
126
|
+
# Justification: Multiple attributes for menu state
|
|
127
|
+
# pylint: disable=too-many-arguments
|
|
113
128
|
def __init__(
|
|
114
129
|
self,
|
|
115
130
|
items: Sequence[MenuItem],
|
|
@@ -117,6 +132,7 @@ class Menu:
|
|
|
117
132
|
viewport: Size2D | None = None,
|
|
118
133
|
title: str | None = None,
|
|
119
134
|
style: MenuStyle | None = None,
|
|
135
|
+
on_select: Optional[Callable[[MenuItem], None]] = None,
|
|
120
136
|
):
|
|
121
137
|
"""
|
|
122
138
|
:param items: Sequence of MenuItem instances to display.
|
|
@@ -136,6 +152,27 @@ class Menu:
|
|
|
136
152
|
self.title = title
|
|
137
153
|
self.style = style or MenuStyle()
|
|
138
154
|
self.selected_index = 0
|
|
155
|
+
self._on_select = on_select
|
|
156
|
+
self._max_content_w_seen = 0
|
|
157
|
+
self._max_button_w_seen = 0
|
|
158
|
+
self.stable_width = True
|
|
159
|
+
|
|
160
|
+
# pylint: enable=too-many-arguments
|
|
161
|
+
|
|
162
|
+
def set_labels(self, labels: Sequence[str]):
|
|
163
|
+
"""Set the labels of the menu items.
|
|
164
|
+
:param labels: Sequence of new labels for the menu items.
|
|
165
|
+
:type labels: Sequence[str]
|
|
166
|
+
"""
|
|
167
|
+
for index, label in enumerate(labels):
|
|
168
|
+
if index < len(self.items):
|
|
169
|
+
item = self.items[index]
|
|
170
|
+
self.items[index] = MenuItem(
|
|
171
|
+
id=item.id,
|
|
172
|
+
label=label,
|
|
173
|
+
on_select=item.on_select,
|
|
174
|
+
label_fn=item.label_fn,
|
|
175
|
+
)
|
|
139
176
|
|
|
140
177
|
def move_up(self):
|
|
141
178
|
"""Move the selection up by one item, wrapping around if necessary."""
|
|
@@ -149,8 +186,11 @@ class Menu:
|
|
|
149
186
|
|
|
150
187
|
def select(self):
|
|
151
188
|
"""Select the currently highlighted item, invoking its action."""
|
|
152
|
-
if self.items:
|
|
153
|
-
|
|
189
|
+
if not self.items:
|
|
190
|
+
return
|
|
191
|
+
item = self.items[self.selected_index]
|
|
192
|
+
if self._on_select is not None:
|
|
193
|
+
self._on_select(item)
|
|
154
194
|
|
|
155
195
|
def handle_event(
|
|
156
196
|
self,
|
|
@@ -159,7 +199,7 @@ class Menu:
|
|
|
159
199
|
up_key: int,
|
|
160
200
|
down_key: int,
|
|
161
201
|
select_key: int,
|
|
162
|
-
):
|
|
202
|
+
) -> bool:
|
|
163
203
|
"""
|
|
164
204
|
Handle an input event to navigate the menu.
|
|
165
205
|
|
|
@@ -176,43 +216,19 @@ class Menu:
|
|
|
176
216
|
:type select_key: int
|
|
177
217
|
"""
|
|
178
218
|
if event.type != EventType.KEYDOWN or event.key is None:
|
|
179
|
-
return
|
|
219
|
+
return False
|
|
220
|
+
|
|
180
221
|
if event.key == up_key:
|
|
181
222
|
self.move_up()
|
|
182
|
-
|
|
223
|
+
return True
|
|
224
|
+
if event.key == down_key:
|
|
183
225
|
self.move_down()
|
|
184
|
-
|
|
226
|
+
return True
|
|
227
|
+
if event.key == select_key:
|
|
185
228
|
self.select()
|
|
229
|
+
return True
|
|
186
230
|
|
|
187
|
-
|
|
188
|
-
# Returns (content_width, content_height, title_height)
|
|
189
|
-
# where content is items-only (no padding)
|
|
190
|
-
if not self.items and not self.title:
|
|
191
|
-
return 0, 0, 0
|
|
192
|
-
|
|
193
|
-
max_w = 0
|
|
194
|
-
title_h = 0
|
|
195
|
-
|
|
196
|
-
if self.title:
|
|
197
|
-
tw, th = surface.measure_text(
|
|
198
|
-
self.title, self.style.title_font_size
|
|
199
|
-
)
|
|
200
|
-
max_w = max(max_w, tw)
|
|
201
|
-
title_h = th
|
|
202
|
-
|
|
203
|
-
# Items
|
|
204
|
-
for it in self.items:
|
|
205
|
-
w, _ = surface.measure_text(it.label, self.style.item_font_size)
|
|
206
|
-
max_w = max(max_w, w)
|
|
207
|
-
|
|
208
|
-
items_h = len(self.items) * self.style.line_height
|
|
209
|
-
|
|
210
|
-
# Total content height includes title block if present
|
|
211
|
-
content_h = items_h
|
|
212
|
-
if self.title:
|
|
213
|
-
content_h += title_h + self.style.title_spacing
|
|
214
|
-
|
|
215
|
-
return max_w, content_h, title_h
|
|
231
|
+
return False
|
|
216
232
|
|
|
217
233
|
def draw(self, surface: Backend):
|
|
218
234
|
"""
|
|
@@ -315,10 +331,17 @@ class Menu:
|
|
|
315
331
|
else:
|
|
316
332
|
max_label_w = 0
|
|
317
333
|
for it in self.items:
|
|
318
|
-
w, _ = surface.measure_text(
|
|
334
|
+
w, _ = surface.measure_text(
|
|
335
|
+
it.label, font_size=self.style.item_font_size
|
|
336
|
+
)
|
|
319
337
|
max_label_w = max(max_label_w, w)
|
|
320
338
|
bw = max_label_w + self.style.button_padding_x * 2
|
|
321
339
|
|
|
340
|
+
# ✅ Sticky button width (never shrink)
|
|
341
|
+
if self.stable_width:
|
|
342
|
+
self._max_button_w_seen = max(self._max_button_w_seen, bw)
|
|
343
|
+
bw = self._max_button_w_seen
|
|
344
|
+
|
|
322
345
|
bh = self.style.button_height
|
|
323
346
|
gap = self.style.button_gap
|
|
324
347
|
|
|
@@ -341,10 +364,18 @@ class Menu:
|
|
|
341
364
|
|
|
342
365
|
# Label color
|
|
343
366
|
text_color = self.style.selected if selected else self.style.normal
|
|
344
|
-
tw, th = surface.measure_text(
|
|
367
|
+
tw, th = surface.measure_text(
|
|
368
|
+
item.label, font_size=self.style.item_font_size
|
|
369
|
+
)
|
|
345
370
|
tx = x + (bw - tw) // 2
|
|
346
371
|
ty = y + (bh - th) // 2
|
|
347
|
-
surface.draw_text(
|
|
372
|
+
surface.draw_text(
|
|
373
|
+
tx,
|
|
374
|
+
ty,
|
|
375
|
+
item.label,
|
|
376
|
+
color=text_color,
|
|
377
|
+
font_size=self.style.item_font_size,
|
|
378
|
+
)
|
|
348
379
|
|
|
349
380
|
# pylint: enable=too-many-locals
|
|
350
381
|
|
|
@@ -353,25 +384,32 @@ class Menu:
|
|
|
353
384
|
max_w = 0
|
|
354
385
|
title_h = 0
|
|
355
386
|
|
|
387
|
+
# Title
|
|
356
388
|
if self.title:
|
|
357
|
-
tw, th = surface.measure_text(
|
|
389
|
+
tw, th = surface.measure_text(
|
|
390
|
+
self.title, font_size=self.style.title_font_size
|
|
391
|
+
)
|
|
358
392
|
max_w = max(max_w, tw)
|
|
359
393
|
title_h = th
|
|
360
394
|
|
|
361
395
|
if not self.items:
|
|
362
|
-
content_h = 0
|
|
363
|
-
|
|
364
|
-
|
|
396
|
+
content_h = title_h if self.title else 0
|
|
397
|
+
# Apply stable width even for empty items
|
|
398
|
+
if self.stable_width:
|
|
399
|
+
self._max_content_w_seen = max(self._max_content_w_seen, max_w)
|
|
400
|
+
max_w = self._max_content_w_seen
|
|
365
401
|
return max_w, content_h, title_h
|
|
366
402
|
|
|
367
403
|
if self.style.button_enabled:
|
|
368
|
-
#
|
|
404
|
+
# Width: fixed or auto-fit by longest label
|
|
369
405
|
if self.style.button_width is not None:
|
|
370
406
|
items_w = self.style.button_width
|
|
371
407
|
else:
|
|
372
408
|
max_label_w = 0
|
|
373
409
|
for it in self.items:
|
|
374
|
-
w, _ = surface.measure_text(
|
|
410
|
+
w, _ = surface.measure_text(
|
|
411
|
+
it.label, font_size=self.style.item_font_size
|
|
412
|
+
)
|
|
375
413
|
max_label_w = max(max_label_w, w)
|
|
376
414
|
items_w = max_label_w + self.style.button_padding_x * 2
|
|
377
415
|
|
|
@@ -382,7 +420,9 @@ class Menu:
|
|
|
382
420
|
items_h = len(self.items) * bh + (len(self.items) - 1) * gap
|
|
383
421
|
else:
|
|
384
422
|
for it in self.items:
|
|
385
|
-
w, _ = surface.measure_text(
|
|
423
|
+
w, _ = surface.measure_text(
|
|
424
|
+
it.label, font_size=self.style.item_font_size
|
|
425
|
+
)
|
|
386
426
|
max_w = max(max_w, w)
|
|
387
427
|
items_h = len(self.items) * self.style.line_height
|
|
388
428
|
|
|
@@ -394,6 +434,11 @@ class Menu:
|
|
|
394
434
|
+ self.style.title_margin_bottom
|
|
395
435
|
)
|
|
396
436
|
|
|
437
|
+
# ✅ Sticky width (never shrink)
|
|
438
|
+
if self.stable_width:
|
|
439
|
+
self._max_content_w_seen = max(self._max_content_w_seen, max_w)
|
|
440
|
+
max_w = self._max_content_w_seen
|
|
441
|
+
|
|
397
442
|
return max_w, content_h, title_h
|
|
398
443
|
|
|
399
444
|
# Justification: Many arguments for text drawing utility
|
|
@@ -414,3 +459,136 @@ class Menu:
|
|
|
414
459
|
)
|
|
415
460
|
|
|
416
461
|
# pylint: enable=too-many-arguments
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
# pylint: enable=too-many-instance-attributes
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
@dataclass
|
|
468
|
+
class MenuModel(SceneModel):
|
|
469
|
+
"""Data model for menu scenes."""
|
|
470
|
+
|
|
471
|
+
up_key: Key = Key.UP
|
|
472
|
+
down_key: Key = Key.DOWN
|
|
473
|
+
select_key: Key = Key.ENTER
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
class MenuSystem(BaseSceneSystem):
|
|
477
|
+
"""
|
|
478
|
+
Scene system to manage menu interaction and rendering.
|
|
479
|
+
|
|
480
|
+
:ivar menu (Menu): The Menu instance being managed.
|
|
481
|
+
"""
|
|
482
|
+
|
|
483
|
+
menu: Menu
|
|
484
|
+
scene: BaseMenuScene
|
|
485
|
+
|
|
486
|
+
def __init__(self, scene):
|
|
487
|
+
super().__init__(scene)
|
|
488
|
+
self.menu: Menu | None = None
|
|
489
|
+
|
|
490
|
+
def on_enter(self):
|
|
491
|
+
self.menu = Menu(
|
|
492
|
+
self.scene.menu_items(),
|
|
493
|
+
viewport=self.scene.size,
|
|
494
|
+
title=self.scene.menu_title,
|
|
495
|
+
style=self.scene.menu_style(),
|
|
496
|
+
on_select=lambda item: item.on_select.execute(self.scene.game),
|
|
497
|
+
)
|
|
498
|
+
|
|
499
|
+
def handle_event(self, event: Event) -> bool:
|
|
500
|
+
if self.menu is None:
|
|
501
|
+
return False
|
|
502
|
+
|
|
503
|
+
# Let menu update selection; on select -> emit event / run command
|
|
504
|
+
selected_action = self.menu.handle_event(
|
|
505
|
+
event,
|
|
506
|
+
up_key=self.scene.model.up_key,
|
|
507
|
+
down_key=self.scene.model.down_key,
|
|
508
|
+
select_key=self.scene.model.select_key,
|
|
509
|
+
)
|
|
510
|
+
return selected_action
|
|
511
|
+
|
|
512
|
+
def draw(self, surface: Backend):
|
|
513
|
+
self.menu.set_labels(
|
|
514
|
+
[it.resolved_label(self.scene.game) for it in self.menu.items]
|
|
515
|
+
)
|
|
516
|
+
self.menu.draw(surface)
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
class BaseMenuScene(Scene):
|
|
520
|
+
"""
|
|
521
|
+
Base scene class for menu-based scenes.
|
|
522
|
+
|
|
523
|
+
:ivar model (MenuModel): The data model for the menu scene.
|
|
524
|
+
"""
|
|
525
|
+
|
|
526
|
+
model: MenuModel
|
|
527
|
+
|
|
528
|
+
def __init__(self, game: Game):
|
|
529
|
+
super().__init__(game)
|
|
530
|
+
self.model = MenuModel()
|
|
531
|
+
|
|
532
|
+
# hooks
|
|
533
|
+
@property
|
|
534
|
+
def menu_title(self) -> str | None:
|
|
535
|
+
"""
|
|
536
|
+
Optional title text for the menu.
|
|
537
|
+
|
|
538
|
+
:return: Title string or None for no title.
|
|
539
|
+
:rtype: str | None
|
|
540
|
+
"""
|
|
541
|
+
return None
|
|
542
|
+
|
|
543
|
+
def menu_style(self) -> MenuStyle:
|
|
544
|
+
"""
|
|
545
|
+
MenuStyle instance for customizing menu appearance.
|
|
546
|
+
|
|
547
|
+
:return: MenuStyle instance.
|
|
548
|
+
:rtype: MenuStyle
|
|
549
|
+
"""
|
|
550
|
+
return MenuStyle()
|
|
551
|
+
|
|
552
|
+
def menu_items(self) -> list[MenuItem]:
|
|
553
|
+
"""
|
|
554
|
+
Return the list of MenuItem instances for this menu.
|
|
555
|
+
|
|
556
|
+
:return: List of MenuItem instances.
|
|
557
|
+
:rtype: list[MenuItem]
|
|
558
|
+
|
|
559
|
+
:raises NotImplementedError: If not overridden in subclass.
|
|
560
|
+
"""
|
|
561
|
+
raise NotImplementedError
|
|
562
|
+
|
|
563
|
+
def quit_command(self) -> BaseCommand[Game] | None:
|
|
564
|
+
"""
|
|
565
|
+
Quit command to bind to ESCAPE and window close events.
|
|
566
|
+
|
|
567
|
+
:return: BaseCommand instance to execute on quit, or None for no action.
|
|
568
|
+
:rtype: BaseCommand[Game] | None
|
|
569
|
+
"""
|
|
570
|
+
return QuitGameCommand() # core default (optional)
|
|
571
|
+
|
|
572
|
+
def on_enter(self):
|
|
573
|
+
# install menu system (core)
|
|
574
|
+
self.services.systems.add(MenuSystem(self))
|
|
575
|
+
|
|
576
|
+
# bind quit if provided
|
|
577
|
+
cmd = self.quit_command()
|
|
578
|
+
if cmd:
|
|
579
|
+
self.services.input.on_key_down(Key.ESCAPE, cmd, "quit")
|
|
580
|
+
self.services.input.on_quit(cmd, "quit")
|
|
581
|
+
|
|
582
|
+
self._systems_on_enter()
|
|
583
|
+
|
|
584
|
+
def handle_event(self, event: Event):
|
|
585
|
+
if self._systems_handle_event(event):
|
|
586
|
+
return
|
|
587
|
+
self.services.input.handle_event(event, self)
|
|
588
|
+
|
|
589
|
+
def draw(self, surface: Backend):
|
|
590
|
+
self._systems_draw(surface)
|
|
591
|
+
|
|
592
|
+
def on_exit(self): ...
|
|
593
|
+
|
|
594
|
+
def update(self, dt: float): ...
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Overlay base classes.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from mini_arcade_core.backend import Backend
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BaseOverlay:
|
|
11
|
+
"""
|
|
12
|
+
Base class for overlays.
|
|
13
|
+
|
|
14
|
+
:ivar enabled (bool): Whether the overlay is enabled.
|
|
15
|
+
:ivar priority (int): Drawing priority; lower values draw first.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
enabled: bool = True
|
|
19
|
+
priority: int = 0 # lower draws first
|
|
20
|
+
|
|
21
|
+
# Justification for unused argument: method is intended to be overridden.
|
|
22
|
+
# pylint: disable=unused-argument
|
|
23
|
+
def update(self, dt: float):
|
|
24
|
+
"""
|
|
25
|
+
Update the overlay state.
|
|
26
|
+
|
|
27
|
+
:param dt: Time delta in seconds.
|
|
28
|
+
:type dt: float
|
|
29
|
+
"""
|
|
30
|
+
return
|
|
31
|
+
|
|
32
|
+
# pylint: enable=unused-argument
|
|
33
|
+
|
|
34
|
+
def draw(self, surface: "Backend"):
|
|
35
|
+
"""
|
|
36
|
+
Draw the overlay on the given surface.
|
|
37
|
+
|
|
38
|
+
:param surface: The backend surface to draw on.
|
|
39
|
+
:type surface: Backend
|
|
40
|
+
"""
|
|
41
|
+
raise NotImplementedError("draw() must be implemented by subclasses.")
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
mini_arcade_core/__init__.py,sha256=3b7F3LyUg7T8qFEy0USDMhgBpV6LCCcxxDvQ8FbaTeo,3588
|
|
2
|
+
mini_arcade_core/backend/__init__.py,sha256=w-6QTUngdIYZuvEU3B8zL-vXyKbyLDVucbt7yKZdLlc,379
|
|
3
|
+
mini_arcade_core/backend/backend.py,sha256=dLXTtLn5qURftWOWOVQd2ouuZmJpbiOl11KMIDRk2us,4026
|
|
4
|
+
mini_arcade_core/backend/events.py,sha256=usn2HTk5-5ZiaU2IjbrNRpEj_4uoaiqfY3qufQLYy0w,2929
|
|
5
|
+
mini_arcade_core/backend/types.py,sha256=SuiwXGNmXCZxfPsww6zj3V_NK7k4jpoCuzMn19afS-g,175
|
|
6
|
+
mini_arcade_core/bus.py,sha256=2Etpoa-UWhk33xJjqDlY5YslPDJEjxNoIEVtF3C73vs,1558
|
|
7
|
+
mini_arcade_core/commands.py,sha256=EpkiyJHuSVrSn410Z5MaeI64fzMoBi0WWA1HG8CQCG8,2185
|
|
8
|
+
mini_arcade_core/entity.py,sha256=5GM3woFrBa6iDwuRbbXNQhUFyCIzpvlh5yI4yrOKZUo,1833
|
|
9
|
+
mini_arcade_core/game.py,sha256=FipqmTMn3g5BB64dQ_VtoA6rssc3N9et90Mg6RKNflM,8535
|
|
10
|
+
mini_arcade_core/keymaps/__init__.py,sha256=_5Y5_61XT5TsOhbb6p2EPzvjCNN9hCPoxTgj_TAfBvA,258
|
|
11
|
+
mini_arcade_core/keymaps/keys.py,sha256=LTg20SwLBI3kpPIiTNpq2yBft_QUGj-iNFSNm9M-Fus,3010
|
|
12
|
+
mini_arcade_core/keymaps/sdl.py,sha256=Tb0amkbmYjYkEkYnMZ6i9QWjwXBkEHIm13-gEMUYENM,2060
|
|
13
|
+
mini_arcade_core/managers/__init__.py,sha256=rLSNjilmAyNTR6djGfpFTahdwKQIBuNUTdZ8sQNjUoI,520
|
|
14
|
+
mini_arcade_core/managers/base.py,sha256=8mfPaOO9j-lx3Uw4a2YJStdwZ5PjRaDCWusfxu5LcyM,2876
|
|
15
|
+
mini_arcade_core/managers/cheats.py,sha256=2tVvEwLmSwyYfmyvTYcauyQ4ZUItwoeES0hG0KS99NQ,10265
|
|
16
|
+
mini_arcade_core/managers/entities.py,sha256=mBgSFgdZ73f5ZZ-_GtvnqOFWuSySX5QJZrZ77sH4qes,831
|
|
17
|
+
mini_arcade_core/managers/inputs.py,sha256=MZ1dTnVDTwvw6nOE3WIB0gUAnSfgIYzfjc68wEuTCpU,8414
|
|
18
|
+
mini_arcade_core/managers/overlays.py,sha256=4DdBExRqoZgXYCDUkBJ_fw3EOpiJ2YqIqadKxS7Cwrg,1452
|
|
19
|
+
mini_arcade_core/managers/system.py,sha256=_nFtHK1wH3xVdqhKco0UUEeUhloyCoHrgz6iDfEt4m4,611
|
|
20
|
+
mini_arcade_core/scenes/__init__.py,sha256=4r8MuW64hJk3rIX5xQxz0FFw4VT2qUq40e0Ot-F_jl0,467
|
|
21
|
+
mini_arcade_core/scenes/autoreg.py,sha256=b4V0jaA65I2hnT2f___rg_pT556OjrtoNjIRdZrXBaI,1009
|
|
22
|
+
mini_arcade_core/scenes/model.py,sha256=ljNlyDf_DenwHuxXZCP5w-WxBg5jg3qtefoNdUulQEA,767
|
|
23
|
+
mini_arcade_core/scenes/registry.py,sha256=0B3iSvepydwMpELQz8cRaQeAU0pR1Fz9O1YtWshLjQw,3226
|
|
24
|
+
mini_arcade_core/scenes/runtime.py,sha256=O1Gc9JJlV3ko9clC4ta1jzJNT7yaQDQDmKuWHAaDkIQ,1096
|
|
25
|
+
mini_arcade_core/scenes/scene.py,sha256=6oAK_RGsh23drKnQo3My88WMVAGC_Uqls7Gixc8iXN4,2911
|
|
26
|
+
mini_arcade_core/scenes/system.py,sha256=clFLFAEVC_RADC9nklF4aT8LPIdovm0miZs5pMJHu2A,1558
|
|
27
|
+
mini_arcade_core/spaces/__init__.py,sha256=i7J7UldFyXPsA98bycrDLarzL7QzwhHBhB3yVP4O_WA,203
|
|
28
|
+
mini_arcade_core/spaces/d2/__init__.py,sha256=iWjm39RYDEshxSmiIWyGWa6Qr9O2gnHfOpzrl63FUro,626
|
|
29
|
+
mini_arcade_core/spaces/d2/boundaries2d.py,sha256=H1HkCR1422MkQIEve2DFKvnav4RpvtLx-qTMxzmdDMQ,2610
|
|
30
|
+
mini_arcade_core/spaces/d2/collision2d.py,sha256=jR5bOmqUaedxRzwFoKBgn7k-ozwklB4RP9pUTVk6aUw,1716
|
|
31
|
+
mini_arcade_core/spaces/d2/geometry2d.py,sha256=js791mMpsE_YbEoqtTOsOxNSflvKgSk6VeVKhj9N318,1282
|
|
32
|
+
mini_arcade_core/spaces/d2/kinematics2d.py,sha256=Lw6WcxpLlw3E-_ZW2iC1WdjSItTIu7K3tam7LuHBabI,2198
|
|
33
|
+
mini_arcade_core/spaces/d2/physics2d.py,sha256=qIq86qWVuvcnLIMEPH6xx7XQO4tQhfiMZY6FseuVOR8,1636
|
|
34
|
+
mini_arcade_core/ui/__init__.py,sha256=_10Z4FYhaPb6LkPaYwvzIj13D7Boy5pYEl7XS_Zfuto,424
|
|
35
|
+
mini_arcade_core/ui/menu.py,sha256=xbpJ_Bf-C8eg2w2frTMCq1pjqMbS6q8G_gSSux4H5ro,18965
|
|
36
|
+
mini_arcade_core/ui/overlays.py,sha256=4f9xJXFVg-NIRoCl1u0Jz4bnxR_C2FueIWPGpguNWc0,982
|
|
37
|
+
mini_arcade_core-0.10.0.dist-info/METADATA,sha256=y9oy4yfi5k9z659kmUsDr_LCqLtz3NUCFbQ7xetJCEo,8189
|
|
38
|
+
mini_arcade_core-0.10.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
39
|
+
mini_arcade_core-0.10.0.dist-info/licenses/LICENSE,sha256=3lHAuV0584cVS5vAqi2uC6GcsVgxUijvwvtZckyvaZ4,1096
|
|
40
|
+
mini_arcade_core-0.10.0.dist-info/RECORD,,
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
mini_arcade_core/__init__.py,sha256=3gb_Q9j5jGlBljwmpExrsXDKZX9FLbCxms9KxhrCOA0,3747
|
|
2
|
-
mini_arcade_core/backend/__init__.py,sha256=w-6QTUngdIYZuvEU3B8zL-vXyKbyLDVucbt7yKZdLlc,379
|
|
3
|
-
mini_arcade_core/backend/backend.py,sha256=dLXTtLn5qURftWOWOVQd2ouuZmJpbiOl11KMIDRk2us,4026
|
|
4
|
-
mini_arcade_core/backend/events.py,sha256=usn2HTk5-5ZiaU2IjbrNRpEj_4uoaiqfY3qufQLYy0w,2929
|
|
5
|
-
mini_arcade_core/backend/types.py,sha256=SuiwXGNmXCZxfPsww6zj3V_NK7k4jpoCuzMn19afS-g,175
|
|
6
|
-
mini_arcade_core/cheats.py,sha256=J0HPLUC6sARXNl_CtUaWhWoo9A0vEjQcIHP6XJUPrNQ,7133
|
|
7
|
-
mini_arcade_core/entity.py,sha256=vDe2v7GajyGaqckBYeD3cjs--pOTFrDNhMIdf7PZsJQ,1759
|
|
8
|
-
mini_arcade_core/game.py,sha256=C8flMXn_DMHWDmr5FVrTey_nUHabwja8wSaialNMcLg,8526
|
|
9
|
-
mini_arcade_core/keymaps/__init__.py,sha256=_5Y5_61XT5TsOhbb6p2EPzvjCNN9hCPoxTgj_TAfBvA,258
|
|
10
|
-
mini_arcade_core/keymaps/keys.py,sha256=LTg20SwLBI3kpPIiTNpq2yBft_QUGj-iNFSNm9M-Fus,3010
|
|
11
|
-
mini_arcade_core/keymaps/sdl.py,sha256=Tb0amkbmYjYkEkYnMZ6i9QWjwXBkEHIm13-gEMUYENM,2060
|
|
12
|
-
mini_arcade_core/scenes/__init__.py,sha256=0zzGFejPZ4CkWHJSkhjRAWA7GbenyZbTGrKOrA5gON4,291
|
|
13
|
-
mini_arcade_core/scenes/autoreg.py,sha256=b4V0jaA65I2hnT2f___rg_pT556OjrtoNjIRdZrXBaI,1009
|
|
14
|
-
mini_arcade_core/scenes/registry.py,sha256=0B3iSvepydwMpELQz8cRaQeAU0pR1Fz9O1YtWshLjQw,3226
|
|
15
|
-
mini_arcade_core/scenes/scene.py,sha256=nAYr-T1RW-7s0a8JrxesJY36iAtpZsA2cqeIZgZWIeU,3962
|
|
16
|
-
mini_arcade_core/two_d/__init__.py,sha256=iWjm39RYDEshxSmiIWyGWa6Qr9O2gnHfOpzrl63FUro,626
|
|
17
|
-
mini_arcade_core/two_d/boundaries2d.py,sha256=H1HkCR1422MkQIEve2DFKvnav4RpvtLx-qTMxzmdDMQ,2610
|
|
18
|
-
mini_arcade_core/two_d/collision2d.py,sha256=jR5bOmqUaedxRzwFoKBgn7k-ozwklB4RP9pUTVk6aUw,1716
|
|
19
|
-
mini_arcade_core/two_d/geometry2d.py,sha256=js791mMpsE_YbEoqtTOsOxNSflvKgSk6VeVKhj9N318,1282
|
|
20
|
-
mini_arcade_core/two_d/kinematics2d.py,sha256=NFMiIzDYqDquyg_EhD7EQBJ_Sz4RncmkEjfls9NwkPs,2102
|
|
21
|
-
mini_arcade_core/two_d/physics2d.py,sha256=qIq86qWVuvcnLIMEPH6xx7XQO4tQhfiMZY6FseuVOR8,1636
|
|
22
|
-
mini_arcade_core/ui/__init__.py,sha256=RmcZXfBFFmL09j_Bo1LHagRjiKYajuySPilIUNjc3KQ,248
|
|
23
|
-
mini_arcade_core/ui/menu.py,sha256=J3hYY46xOHLN65WSet4-cnQU7L5pu48scjLJUW9IkEM,13681
|
|
24
|
-
mini_arcade_core-0.9.8.dist-info/METADATA,sha256=YkzK5IIHDjJN4hTAu9dAUiOOAiOFLEm15zMwJMxDcTs,8188
|
|
25
|
-
mini_arcade_core-0.9.8.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
26
|
-
mini_arcade_core-0.9.8.dist-info/licenses/LICENSE,sha256=3lHAuV0584cVS5vAqi2uC6GcsVgxUijvwvtZckyvaZ4,1096
|
|
27
|
-
mini_arcade_core-0.9.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|