diff --git a/adafruit_display_text/label.py b/adafruit_display_text/label.py index 251ba17..9f54b28 100755 --- a/adafruit_display_text/label.py +++ b/adafruit_display_text/label.py @@ -58,7 +58,7 @@ class Label(displayio.Group): :param int color: Color of all text in RGB hex :param double line_spacing: Line spacing of text to display""" - # pylint: disable=too-many-instance-attributes + # pylint: disable=too-many-instance-attributes, too-many-locals # This has a lot of getters/setters, maybe it needs cleanup. def __init__( @@ -77,6 +77,8 @@ def __init__( padding_bottom=0, padding_left=0, padding_right=0, + anchor_point=None, + anchored_position=None, **kwargs ): if "scale" in kwargs.keys(): @@ -93,7 +95,10 @@ def __init__( self.width = max_glyphs self._font = font self._text = None - self._anchor_point = (0, 0) + if anchor_point is None: + self._anchor_point = (0, 0) + else: + self._anchor_point = anchor_point self.x = x self.y = y @@ -121,6 +126,8 @@ def __init__( if text is not None: self._update_text(str(text)) + if anchored_position is not None: + self.anchored_position = anchored_position def _create_background_box(self, lines, y_offset):