-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83270f4
commit 1cd0ea4
Showing
8 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import logging | ||
from ecs_pattern import EntityManager | ||
from typing import Tuple | ||
from ....entities import ( | ||
Cache, | ||
WidgetClockDate, | ||
WidgetClockTime, | ||
WidgetTronGrid, | ||
WidgetTileGrid, | ||
) | ||
from ..sprites import build_image_sprite | ||
from . import Stage | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class StageTron(Stage): | ||
def __init__( | ||
self, | ||
entities: EntityManager, | ||
display_size: Tuple[int, int], | ||
) -> None: | ||
super().__init__(entities) | ||
self.display_size = display_size | ||
self.setup() | ||
|
||
def setup(self) -> None: | ||
self.cache = next(self.entities.get_by_class(Cache)) | ||
|
||
self.stage_entities.extend( | ||
[ | ||
WidgetTronGrid( | ||
build_image_sprite(self.cache.surfaces["mode7_tron_grid"][0]), | ||
x=0, | ||
y=0, | ||
z_order=5, | ||
frames=self.cache.surfaces["mode7_tron_grid"], | ||
frame_delay=1, | ||
), # type: ignore[call-arg] | ||
] | ||
) | ||
|
||
for w in self.entities.get_by_class( | ||
WidgetClockDate, | ||
WidgetClockTime, | ||
WidgetTileGrid, | ||
): | ||
w.fade_target_alpha = 255 |