Skip to content

Commit 2086944

Browse files
authored
Merge pull request #1 from adafruit/master
update to master
2 parents 8ca3c1a + 3fa0b2c commit 2086944

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

adafruit_display_text/label.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Label(displayio.Group):
5656
:param int max_glyphs: The largest quantity of glyphs we will display
5757
:param int color: Color of all text in RGB hex
5858
:param double line_spacing: Line spacing of text to display"""
59-
def __init__(self, font, *, text=None, max_glyphs=None, color=0xffffff,
59+
def __init__(self, font, *, x=0, y=0, text=None, max_glyphs=None, color=0xffffff,
6060
line_spacing=1.25, **kwargs):
6161
if not max_glyphs and not text:
6262
raise RuntimeError("Please provide a max size, or initial text")
@@ -67,8 +67,8 @@ def __init__(self, font, *, text=None, max_glyphs=None, color=0xffffff,
6767
self.font = font
6868
self._text = None
6969
self._anchor_point = (0, 0)
70-
self.x = 0
71-
self.y = 0
70+
self.x = x
71+
self.y = y
7272

7373
self.palette = displayio.Palette(2)
7474
self.palette.make_transparent(0)
@@ -79,8 +79,8 @@ def __init__(self, font, *, text=None, max_glyphs=None, color=0xffffff,
7979
self._line_spacing = line_spacing
8080
self._boundingbox = None
8181

82-
if text:
83-
self._update_text(text)
82+
if text is not None:
83+
self._update_text(str(text))
8484

8585

8686
def _update_text(self, new_text): # pylint: disable=too-many-locals
@@ -175,7 +175,7 @@ def text(self):
175175

176176
@text.setter
177177
def text(self, new_text):
178-
self._update_text(new_text)
178+
self._update_text(str(new_text))
179179

180180
@property
181181
def anchor_point(self):

0 commit comments

Comments
 (0)