Skip to content
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

Add text kwarg to optionally forward to PortalBase.add_text #88

Merged
merged 2 commits into from
Feb 21, 2023
Merged
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions adafruit_matrixportal/matrixportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def add_text(
line_spacing=1.25,
text_anchor_point=(0, 0.5),
is_data=True,
text=None
):
"""
Add text labels with settings
Expand All @@ -166,6 +167,11 @@ def add_text(
:param (float, float) text_anchor_point: Values between 0 and 1 to indicate where the text
position is relative to the label
:param bool is_data: If True, fetch will attempt to update the label
:param str text: If this is provided, it will set the initial text of the label.

:return: Index of the new text label.
:rtype: int

"""
if scrolling:
if text_position is None:
Expand All @@ -185,6 +191,7 @@ def add_text(
line_spacing=line_spacing,
text_anchor_point=text_anchor_point,
is_data=is_data,
text=text
)

self._text[index]["scrolling"] = scrolling
Expand Down