-
Notifications
You must be signed in to change notification settings - Fork 10
Allow text slides #27
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
Conversation
merge from adafruit
This probably closes #23 in my mind. This is a little more narrow than the issue mentions, but does fulfill the original goal of text and images mixed. I have a few other things in mind I'd like to implement still:
But I was interested to see if there is any feedback on the idea generally or what I have so far. |
@kattni please test |
@FoamyGuy Hey! Thanks for adding this. I tried testing it on a PyBadge, and it's not working. I had to modify the simpletest to not have the
My example code is:
|
I was informed that it requires
|
I think there may be some issue with the way it's trying to ignore hidden files whose name start with a dot. I will be working on this some more later tonight. I should be able to resolve the above error. I will also test it out on some MagTag, PyBadge as well and make any tweaks needed to get it working, so far all of my testing was on PyPortal. I'm also hoping I can get the last two features mentioned implemented tonight, but unsure if I'll make it. I will make a comment here with the new status after my commits tonight. |
… in _file_list items. Update simpletest
The latest commits fix contain the following:
I tested this version successfully on PyBadge and MagTag. Here is how the example text json looks on the MagTag |
The new commit adds support for custom fonts by declaring them in the json file like this one: {
"text": "Sample Text\nSlideshow",
"h_align": "CENTER",
"v_align": "CENTER",
"color": "0x000000",
"background_color": "0xFFFFFF",
"scale": 2,
"font": "Helvetica-Bold-16.bdf"
} I did look into adding template variables but I think it's maybe something for the future. It needs some thought about how to pass the variables to the slideshow object. I think this is ready to go now. One thing to note for @kattni or whoever tests is the simpletest example is now looking in |
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 successfully on MagTag. Thanks for adding this feature!
Updating https://github.com/adafruit/Adafruit_CircuitPython_Fingerprint to 2.1.1 from 2.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_Fingerprint#25 from jerryneedell/jerryn_r503_save Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 5.1.6 from 5.1.5: > Merge pull request adafruit/Adafruit_CircuitPython_LIS3DH#65 from caternuson/iss64 Updating https://github.com/adafruit/Adafruit_CircuitPython_RPLIDAR to 1.1.3 from 1.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_RPLIDAR#11 from kevin-balkoski-enview/typo-fixes Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.0.2 from 5.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#55 from DougBurke/patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.2.3 from 1.2.2: > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#30 from FoamyGuy/magtag_example Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 2.0.3 from 2.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#28 from FoamyGuy/add_magtag_example Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 1.9.5 from 1.9.4: > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#52 from makermelissa/master > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#48 from slootsky/feature/get_local_time_ignores_location_parameter Updating https://github.com/adafruit/Adafruit_CircuitPython_Slideshow to 1.5.0 from 1.4.0: > Merge pull request adafruit/Adafruit_CircuitPython_Slideshow#27 from FoamyGuy/text_slides
With these changes we can now use a file json file containing data like:
It will create a label to show configured as specified by the json.
text
is the only required property. Any json files that do not containtext
property are ignored.h_align
andv_align
properties from the json supersede the ones set on the SlideShow.I have renamed many things that referred to "image" to now use "slide" instead since it can hold different types of things now.
The sample json above is included in
examples/images/