|
| 1 | +from dumbdisplay.ddcmds import DDC_setlevelanchor, DDC_movelevelanchorby |
1 | 2 | from dumbdisplay.ddimpl import DumbDisplayImpl |
2 | 3 | from dumbdisplay.ddlayer import DDLayer, _DD_BOOL_ARG, _DD_FLOAT_ARG, _DD_INT_ARG, _DD_FLOAT_IS_ZERO |
3 | 4 |
|
@@ -71,20 +72,20 @@ def setLevelAnchor(self, x: float, y: float, reach_in_millis: int = 0): |
71 | 72 | """ |
72 | 73 | set the anchor of the level; note that level anchor is the top-left corner of the level "opening" |
73 | 74 | """ |
74 | | - command = "setlevelanchor" if self.dd._compatibility < 15 else "SLA" |
| 75 | + #command = "setlevelanchor" if self.dd._compatibility < 15 else "SLA" |
75 | 76 | 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)) |
77 | 78 | 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)) |
79 | 80 | def moveLevelAnchorBy(self, by_x: float, by_y: float, reach_in_millis: int = 0): |
80 | 81 | """ |
81 | 82 | move the level anchor |
82 | 83 | """ |
83 | | - command = "movelevelanchorby" if self.dd._compatibility < 15 else "MLAB" |
| 84 | + #command = "movelevelanchorby" if self.dd._compatibility < 15 else "MLAB" |
84 | 85 | 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)); |
86 | 87 | 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)); |
88 | 89 | def registerLevelBackground(self, background_id: str, background_image_name: str, draw_background_options: str = ""): |
89 | 90 | """ |
90 | 91 | register an image for setting as level's background |
|
0 commit comments