@@ -56,7 +56,7 @@ class Label(displayio.Group):
56
56
:param int max_glyphs: The largest quantity of glyphs we will display
57
57
:param int color: Color of all text in RGB hex
58
58
: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 ,
60
60
line_spacing = 1.25 , ** kwargs ):
61
61
if not max_glyphs and not text :
62
62
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,
67
67
self .font = font
68
68
self ._text = None
69
69
self ._anchor_point = (0 , 0 )
70
- self .x = 0
71
- self .y = 0
70
+ self .x = x
71
+ self .y = y
72
72
73
73
self .palette = displayio .Palette (2 )
74
74
self .palette .make_transparent (0 )
@@ -79,8 +79,8 @@ def __init__(self, font, *, text=None, max_glyphs=None, color=0xffffff,
79
79
self ._line_spacing = line_spacing
80
80
self ._boundingbox = None
81
81
82
- if text :
83
- self ._update_text (text )
82
+ if text is not None :
83
+ self ._update_text (str ( text ) )
84
84
85
85
86
86
def _update_text (self , new_text ): # pylint: disable=too-many-locals
@@ -175,7 +175,7 @@ def text(self):
175
175
176
176
@text .setter
177
177
def text (self , new_text ):
178
- self ._update_text (new_text )
178
+ self ._update_text (str ( new_text ) )
179
179
180
180
@property
181
181
def anchor_point (self ):
0 commit comments