Skip to content

Added x and y as keyword arguments. #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions adafruit_display_text/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Label(displayio.Group):
:param int max_glyphs: The largest quantity of glyphs we will display
:param int color: Color of all text in RGB hex
:param double line_spacing: Line spacing of text to display"""
def __init__(self, font, *, text=None, max_glyphs=None, color=0xffffff,
def __init__(self, font, *, x=0, y=0, text=None, max_glyphs=None, color=0xffffff,
line_spacing=1.25, **kwargs):
if not max_glyphs and not text:
raise RuntimeError("Please provide a max size, or initial text")
Expand All @@ -67,8 +67,8 @@ def __init__(self, font, *, text=None, max_glyphs=None, color=0xffffff,
self.font = font
self._text = None
self._anchor_point = (0, 0)
self.x = 0
self.y = 0
self.x = x
self.y = y

self.palette = displayio.Palette(2)
self.palette.make_transparent(0)
Expand Down