Skip to content

Commit 73aaa01

Browse files
committed
add comment
1 parent 950ef06 commit 73aaa01

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

adafruit_display_text/label.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,21 @@
4545
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Display_Text.git"
4646

4747
class Label(displayio.Group):
48-
"""An area displaying a string of textself.
48+
"""An area displaying a string of textself. The origin point set by ``x`` and ``y``
49+
properties will be the left edge of the bounding box, and in the center of a M
50+
glyph (if its one line), or the (number of lines * linespacing + M)/2. That is,
51+
it will try to have it be center-left as close as possible.
4952
5053
:param Font font: A font class that has ``get_bounding_box`` and ``get_glyph``
5154
:param str text: Text to display
5255
:param int max_glyphs: The largest quantity of glyphs we will display
5356
:param int color: Color of all text in RGB hex"""
54-
def __init__(self, font, *, text=None, max_glyphs=None, color=0xffffff):
57+
def __init__(self, font, *, text=None, max_glyphs=None, color=0xffffff, **kwargs):
5558
if not max_glyphs and not text:
5659
raise RuntimeError("Please provide a max size, or initial text")
5760
if not max_glyphs:
5861
max_glyphs = len(text)
59-
super().__init__(max_size=max_glyphs)
62+
super().__init__(max_size=max_glyphs, **kwargs)
6063
self.width = max_glyphs
6164
self.font = font
6265
self._text = None

0 commit comments

Comments
 (0)