I decided to change the API for GFX layers after @marcmerlin pointed out some issues. It’s now simpler, just define USE_ADAFRUIT_GFX_LAYERS
at the top of a sketch, and your sketch is now using the new GFX layers. (Before you had to define SUPPORT_ADAFRUIT_GFX_LIBRARY
, and change the ALLOCATE_*
macros to ALLOCATE_GFX*
macros in your sketch)
I didn’t want to have a breaking API change days after the release of SmartMatrix Library 4.0, but I think Marc’s suggestion was good enough to make the change before more people started using the library.
In the process of making that change, I updated the MultipleTextLayersGfx Example to show some of the issues with using GFX layers (memory allocation is more complex), and added a helper function to help determine how large a Layer needs to be based on the text you want to scroll.
I’ll be adding more details to the documentation in the Wiki as these new layers have some pitfalls, plus they haven’t been tested as much and there’s likely bugs (I found and fixed a couple in the process of doing the above changes)