diff --git a/pybricks/_display.py b/pybricks/_display.py index 9f7f379..5c113c7 100644 --- a/pybricks/_display.py +++ b/pybricks/_display.py @@ -39,8 +39,8 @@ class Display(): pass - def image(self, file_name, alignment=Align.center, coordinate=None, clear=True): - """image(file_name, alignment=Align.center, coordinate=None, clear=True) + def image(self, file_name, alignment=Align.CENTER, coordinate=None, clear=True): + """image(file_name, alignment=Align.CENTER, coordinate=None, clear=True) Show an image file. @@ -48,7 +48,7 @@ class Display(): Arguments: file_name (str): Path to the image file. Paths may be absolute or relative from the project folder. - alignment (Align): Where to place the image (*Default*: Align.center). + alignment (Align): Where to place the image (*Default*: Align.CENTER). coordinate (tuple): ``(x, y)`` coordinate tuple. It is the top-left corner of the image (*Default*: None). clear (bool): Whether to clear the screen before showing the image (*Default*: ``True``). @@ -62,7 +62,7 @@ class Display(): # Display a custom image image at the top right of the screen, without clearing # the screen first - brick.display.image('arrow.png', Align.top_right, clear=False) + brick.display.image('arrow.png', Align.TOP_RIGHT, clear=False) """ pass diff --git a/pybricks/parameters.py b/pybricks/parameters.py index f6014be..be88508 100644 --- a/pybricks/parameters.py +++ b/pybricks/parameters.py @@ -197,25 +197,25 @@ class Button(Enum): class Align(): """Alignment of an image on the display. - .. data:: bottom_left - .. data:: bottom - .. data:: bottom_right - .. data:: left - .. data:: center - .. data:: right - .. data:: top_left - .. data:: top - .. data:: top_right + .. data:: BOTTOM_LEFT + .. data:: BOTTOM + .. data:: BOTTOM_RIGHT + .. data:: LEFT + .. data:: CENTER + .. data:: RIGHT + .. data:: TOP_LEFT + .. data:: TOP + .. data:: TOP_RIGHT """ - bottom_left = 1 - bottom = 2 - bottom_right = 3 - left = 4 - center = 5 - right = 6 - top_left = 7 - top = 8 - top_right = 9 + BOTTOM_LEFT = 1 + BOTTOM = 2 + BOTTOM_RIGHT = 3 + LEFT = 4 + CENTER = 5 + RIGHT = 6 + TOP_LEFT = 7 + TOP = 8 + TOP_RIGHT = 9 class Sound():