TFTShape is a 2D graphics library designed to work with the Bodmer/TFT_eSPI library which supports SPI-TFT-displays for ESP8266/ESP32 processors. This library is abstracting low level primitives (pixels, lines) to bring them together for use as shape-based 2D drawing functions. It was developed to have an efficient implementation with a low footprint to run with best performance on the target processors. TFTShape has successfully been tested on an ODROID-GO (ILI9341 and ESP32@150MHz Wrover inside).
TFTShape uses, as the name states, a shape based concept. Shapes are containers for groups of vertices which will be interpreted mostly as closed polygons, but depending on the used shape, the vertices can also be single points, open polygons or independent lines. Shapes have all common 2D drawing functions implemented, this includes sizing, translation, rotation, setting a pivot point and filling functions. Shapes can also be used to draw another shape at the position of the parent shape's vertices (grouping).
Following classes and subclasses are available:
- TFTShape - represents points and closed lines (polygons)
- TFTLineShape - represents individual lines
- TFTSplineShape - represents points interpreted as B-splines (open and looped splines)
- TFTLinestripShape - represent contiguous lines (not closed)
- TFTShapeBuilder - Factory to create special shapes, ie. grids,splines,stars, n-gons etc.
To have an overview about the various output this library can produce, here are screenshots from the testsuite of the examples directory:
- Install Bodmer/TFT_eSPI library and make sure examples are running.
- Download zip and move extraced directory to the arduino libraries folder or use the Library Manager and select
install from zip
- From the arduino file menu select examples TFTShape