Skip to content

Commit 5182045

Browse files
committed
updated
1 parent ac3213f commit 5182045

8 files changed

Lines changed: 12 additions & 7 deletions

File tree

dd_demo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ def run_mnist_app():
315315

316316

317317
if __name__ == "__main__":
318-
demo_AutoPin()
318+
#run_sliding_puzzle_app()
319+
#run_mnist_app()
320+
#demo_AutoPin()
319321
demo_LayerTurtle()
320322

321323
if True:

dumbdisplay/ddcmds.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DDC_setlevelanchor = "#3a"
2+
DDC_movelevelanchorby = "#3b"

dumbdisplay/ddlayer_multilevel.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from dumbdisplay.ddcmds import DDC_setlevelanchor, DDC_movelevelanchorby
12
from dumbdisplay.ddimpl import DumbDisplayImpl
23
from dumbdisplay.ddlayer import DDLayer, _DD_BOOL_ARG, _DD_FLOAT_ARG, _DD_INT_ARG, _DD_FLOAT_IS_ZERO
34

@@ -71,20 +72,20 @@ def setLevelAnchor(self, x: float, y: float, reach_in_millis: int = 0):
7172
"""
7273
set the anchor of the level; note that level anchor is the top-left corner of the level "opening"
7374
"""
74-
command = "setlevelanchor" if self.dd._compatibility < 15 else "SLA"
75+
#command = "setlevelanchor" if self.dd._compatibility < 15 else "SLA"
7576
if reach_in_millis > 0:
76-
self.dd._sendCommand(self.layer_id, command, _DD_FLOAT_ARG(x), _DD_FLOAT_ARG(y), _DD_INT_ARG(reach_in_millis))
77+
self.dd._sendCommand(self.layer_id, DDC_setlevelanchor, _DD_FLOAT_ARG(x), _DD_FLOAT_ARG(y), _DD_INT_ARG(reach_in_millis))
7778
else:
78-
self.dd._sendCommand(self.layer_id, command, _DD_FLOAT_ARG(x), _DD_FLOAT_ARG(y))
79+
self.dd._sendCommand(self.layer_id, DDC_setlevelanchor, _DD_FLOAT_ARG(x), _DD_FLOAT_ARG(y))
7980
def moveLevelAnchorBy(self, by_x: float, by_y: float, reach_in_millis: int = 0):
8081
"""
8182
move the level anchor
8283
"""
83-
command = "movelevelanchorby" if self.dd._compatibility < 15 else "MLAB"
84+
#command = "movelevelanchorby" if self.dd._compatibility < 15 else "MLAB"
8485
if reach_in_millis > 0:
85-
self.dd._sendCommand(self.layer_id, command, _DD_FLOAT_ARG(by_x), _DD_FLOAT_ARG(by_y), _DD_INT_ARG(reach_in_millis));
86+
self.dd._sendCommand(self.layer_id, DDC_movelevelanchorby, _DD_FLOAT_ARG(by_x), _DD_FLOAT_ARG(by_y), _DD_INT_ARG(reach_in_millis));
8687
else:
87-
self.dd._sendCommand(self.layer_id, command, _DD_FLOAT_ARG(by_x), _DD_FLOAT_ARG(by_y));
88+
self.dd._sendCommand(self.layer_id, DDC_movelevelanchorby, _DD_FLOAT_ARG(by_x), _DD_FLOAT_ARG(by_y));
8889
def registerLevelBackground(self, background_id: str, background_image_name: str, draw_background_options: str = ""):
8990
"""
9091
register an image for setting as level's background

dumbdisplay_examples/tetris_classic/tetris_classic.py renamed to dumbdisplay_examples/OLD/tetris_classic/tetris_classic.py

File renamed without changes.

dumbdisplay_examples/tetris_classic/tetris_classic_OLD_0.py renamed to dumbdisplay_examples/OLD/tetris_classic/tetris_classic_OLD_0.py

File renamed without changes.
File renamed without changes.

dumbdisplay_examples/tetris_one_block/tetris_one_block.py renamed to dumbdisplay_examples/OLD/tetris_one_block/tetris_one_block.py

File renamed without changes.

dumbdisplay_examples/tetris_one_block/tetris_one_block_2.py renamed to dumbdisplay_examples/OLD/tetris_one_block/tetris_one_block_2.py

File renamed without changes.

0 commit comments

Comments
 (0)