-
Notifications
You must be signed in to change notification settings - Fork 38
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
adding anchored position example #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on a PyPortal. Works. Changes are mainly cosmetic.
text_group.append(text_area_bottom_right) | ||
|
||
print(text_area_top_right.anchored_position) | ||
print(text_area_top_right.anchor_point) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still need these prints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say the prints are not really essential, I mainly put them to test and ensure the getters were working as expected. I can remove them.
text_area_middle_right.anchor_point = (1.0, 0.5) | ||
text_area_middle_right.anchored_position = (DISPLAY_WIDTH-10, DISPLAY_HEIGHT/2) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line
DISPLAY_HEIGHT = 240 | ||
|
||
text_group = displayio.Group(max_size=9) | ||
text = "Hello" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is like a const, so maybe change it to TEXT
and move it up by the DISPLAY_
defs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, agreed. Will do.
DISPLAY_WIDTH = 320 | ||
DISPLAY_HEIGHT = 240 | ||
|
||
text_group = displayio.Group(max_size=9) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be better moved to just before your first text_group.append
line below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, better to keep the text_group
setup together than have it split by all of the lines setting up labels. I will make this change along with the others in the next commit
…. moving text_group setup code all together. cleanup some whitespace.
Thanks for the updates. Looks good. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 3.1.9 from 3.1.8: > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#64 from cogliano/master Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.2.0 from 2.1.6: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#30 from FoamyGuy/master > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#22 from neoxharsh/master
No description provided.