TFT_eSPI includes a family of anti-aliased (“smooth”) drawing primitives that blend glyph edges against the background color rather than painting hard pixel borders. The result looks noticeably cleaner on small, high-pixel-density panels where aliasing artifacts are most visible. Every smooth function accepts aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Marcussacapuces91/doc-TFT_eSPI/llms.txt
Use this file to discover all available pages before exploring further.
bg_color parameter that controls what color edge pixels are blended toward. When bg_color is omitted (or set to the sentinel value 0x00FFFFFF), the library reads the actual background pixel directly from the display — convenient but slower. Passing an explicit bg_color avoids that read and is always the faster option.
Anti-aliased drawing is more CPU-intensive than plain drawing. For small decorative elements such as gauge needles, dial rings, or indicator dots it is an excellent trade-off. For full-screen animations prefer the non-smooth variants.
The bg_color Sentinel
The default value 0x00FFFFFF is used as a sentinel meaning “read the background from the display”. Any other 24-bit value is treated as an explicit background color and skips the pixel read.
Spots (Anti-Aliased Filled Circles)
drawSpot
Draw a small anti-aliased filled circle (a “spot”) at a sub-pixel floating-point position. Internally uses drawWideLine with zero length, so it inherits rounded ends naturally.
Sub-pixel X coordinate of the center.
Sub-pixel Y coordinate of the center.
Radius in pixels (floating point for sub-pixel precision).
Foreground fill color.
Background blend color. Defaults to
0x00FFFFFF (read from display).Wide and Wedge Lines
drawWideLine
Draw an anti-aliased line with a constant width wd at both ends, with radiused caps.
Start point (sub-pixel precision).
End point (sub-pixel precision).
Line width in pixels at both ends.
Line color.
Background blend color. Defaults to
0x00FFFFFF.drawWedgeLine
Draw an anti-aliased line that tapers: aw sets the radius (half-width) at the start point and bw sets it at the end. This creates a wedge or tapered stroke, ideal for gauge needles and arrows.
Start point.
End point.
Half-width (radius) at the start.
Half-width (radius) at the end.
Line color.
Background blend color. Defaults to
0x00FFFFFF.Arcs
drawSmoothArc
Draw an anti-aliased arc segment. The arc is defined by an outer radius r and an inner radius ir, making it a thick annular sector. Arc thickness = r - ir + 1.
Angle 0 is at the 6 o’clock position and increases clockwise (90° = 9 o’clock, 180° = 12 o’clock, 270° = 3 o’clock). Arcs always draw clockwise from startAngle to endAngle; the start may be numerically larger than the end to wrap around.
Center coordinates.
Outer radius in pixels.
Inner radius in pixels. Arc thickness =
r - ir + 1.Start angle in degrees
[0..360].End angle in degrees
[0..360].Arc foreground color, anti-aliased against
bg_color at edges.Background blend color.
Round the arc endpoints. Defaults to
false.drawArc
Identical to drawSmoothArc except the arc ends are not anti-aliased, and side anti-aliasing can be disabled. This is useful for drawing segmented arcs where clean joints between adjacent segments are required.
When
true (default), sides are anti-aliased. Set to false to disable all anti-aliasing for crisp segmented joins.Smooth Circles
drawSmoothCircle
Draw an anti-aliased circle outline. The rendered line is 3 pixels wide to reduce the “braiding” artifact that appears with 1-pixel anti-aliased circles.
Center coordinates.
Radius. Inner AA zone at
r-1, outer AA zone at r+1.Circle outline color.
Background blend color.
fillSmoothCircle
Draw an anti-aliased filled circle, blending the edge pixels against bg_color.
Center coordinates.
Radius in pixels.
Fill color.
Background blend color. Defaults to
0x00FFFFFF.Smooth Rounded Rectangles
drawSmoothRoundRect
Draw an anti-aliased rounded rectangle outline. The corner arcs are defined by an outer radius r and an inner radius ir; arc thickness = r - ir + 1. A bitmask quadrants lets you draw only selected corners.
Top-left corner of the bounding box.
Outer corner radius.
Inner corner radius. If
w and h are both 0, a circle is drawn.Width and height of the bounding box.
Foreground (outline) color.
Background blend color. Defaults to
0x00FFFFFF.Bitmask selecting which corners to draw (default
0xF = all four). Bit layout:| Left | Right | |
|---|---|---|
| Top | 0x1 | 0x2 |
| Bottom | 0x8 | 0x4 |
fillSmoothRoundRect
Draw an anti-aliased filled rounded rectangle.
Top-left corner.
Width and height.
Corner radius.
Fill color.
Background blend color. Defaults to
0x00FFFFFF.Practical Example — Gauge / Dial
The sketch below builds a simple gauge face with a colored arc track, a background ring, and a tapered needle usingdrawSmoothArc and drawWedgeLine.
Shape Primitives
Plain (non-anti-aliased) drawing functions for pixels, lines, and shapes.
Bitmaps and Images
Push color pixel arrays and PROGMEM bitmaps to the display.