TFT_eSPI provides a rich set of shape-drawing methods for rendering outlines, lines, curves, and bitmaps to the display. These methods draw the border or path of a shape without filling its interior — for solid fills see the Filling Shapes reference. Several methods have anti-aliased “smooth” variants that blend edges with the background for sub-pixel precision. All coordinate parameters use screen pixels withDocumentation 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.
(0, 0) at the top-left corner of the current rotation.
drawPixel() — Draw a Single Pixel
color over bg_color using the given alpha value. If bg_color is omitted (left at 0x00FFFFFF) the background is read directly from the TFT or sprite.
Horizontal pixel coordinate.
Vertical pixel coordinate.
Pixel colour in RGB565 or a
TFT_* colour constant.Alpha blend value (0 = fully transparent, 255 = fully opaque). Only used by overload 2.
Background colour for blending. Default
0x00FFFFFF causes the background to be read from the display. Only used by overload 2.uint16_t — the resulting RGB565 pixel colour after alpha blending.
drawLine() — Arbitrary Line
X coordinate of the start point.
Y coordinate of the start point.
X coordinate of the end point.
Y coordinate of the end point.
Line colour.
drawFastHLine() / drawFastVLine() — Optimized Axis-Aligned Lines
drawLine() for axis-aligned lines because a single address-window command covers the entire span.
X start coordinate.
Y start coordinate.
Length in pixels for the horizontal line.
Length in pixels for the vertical line.
Line colour.
drawRect() — Rectangle Outline
(x, y).
X coordinate of the top-left corner.
Y coordinate of the top-left corner.
Rectangle width in pixels.
Rectangle height in pixels.
Border colour.
drawRoundRect() — Rounded Rectangle Outline
X coordinate of the top-left corner.
Y coordinate of the top-left corner.
Rectangle width.
Rectangle height.
Corner arc radius in pixels. Larger values produce more rounded corners.
Border colour.
drawSmoothRoundRect() — Anti-Aliased Rounded Rectangle
r - ir + 1. If w and h are both 0 a full circle is drawn centred at (x + r, y + r). Omitting bg_color causes the background to be read from the display.
X coordinate of the bounding box top-left corner.
Y coordinate of the bounding box top-left corner.
Outer corner radius.
Inner corner radius. Arc thickness =
r - ir + 1.Bounding box width (set to 0 for a circle).
Bounding box height (set to 0 for a circle).
Foreground (arc) colour.
Background colour for anti-aliasing. Default
0x00FFFFFF reads from the display.Bitmask selecting which quadrants to draw (default
0xF = all four). Bit layout: top-left=0x1, top-right=0x2, bottom-right=0x4, bottom-left=0x8.drawCircle() — Circle Outline
X coordinate of the centre.
Y coordinate of the centre.
Radius in pixels.
Outline colour.
drawSmoothCircle() — Anti-Aliased Circle Outline
r - 1 and the outer zone at r + 1.
X coordinate of the centre.
Y coordinate of the centre.
Radius in pixels.
Foreground (circle) colour.
Background colour used for anti-aliasing.
drawCircleHelper() — Quadrant Arc Helper
drawRoundRect(). The cornername bitmask selects which quadrants to render: bit 0 = top-left, bit 1 = top-right, bit 2 = bottom-right, bit 3 = bottom-left.
X coordinate of the circle centre.
Y coordinate of the circle centre.
Radius in pixels.
Bitmask of quadrants to draw (0x1–0xF).
Arc colour.
drawEllipse() — Ellipse Outline
X coordinate of the centre.
Y coordinate of the centre.
Horizontal radius (semi-axis along X).
Vertical radius (semi-axis along Y).
Outline colour.
drawTriangle() — Triangle Outline
X coordinate of vertex 1.
Y coordinate of vertex 1.
X coordinate of vertex 2.
Y coordinate of vertex 2.
X coordinate of vertex 3.
Y coordinate of vertex 3.
Outline colour.
drawArc() — Arc (Configurable Anti-Aliasing)
smoothArc.
X coordinate of the arc centre.
Y coordinate of the arc centre.
Outer radius of the arc.
Inner radius (arc thickness =
r - ir + 1).Start angle in degrees (0–360). 0° = 6 o’clock.
End angle in degrees (0–360). Arc draws clockwise from start to end.
Foreground (arc) colour.
Background colour for anti-aliasing.
If
true (default), sides are anti-aliased. Set false for hard-edged arc sides.drawSmoothArc() — Arc with Anti-Aliased Ends
drawArc() but the arc ends are also anti-aliased. Optionally rounded end caps can be enabled with roundEnds = true.
X coordinate of the arc centre.
Y coordinate of the arc centre.
Outer arc radius.
Inner arc radius.
Start angle 0–360° (0 = 6 o’clock).
End angle 0–360°.
Arc colour.
Background colour for end-cap anti-aliasing.
If
true, arc ends are rounded. Default false gives straight anti-aliased ends.drawSpot() — Anti-Aliased Filled Circle (Sub-Pixel)
drawWideLine(). This is maths-intensive and intended only for small circles.
Floating-point X coordinate of the centre.
Floating-point Y coordinate of the centre.
Radius in pixels (floating-point).
Spot colour.
Background colour. Default
0x00FFFFFF reads from the display.drawWideLine() — Anti-Aliased Wide Line (Uniform Width)
wd and rounded ends from (ax, ay) to (bx, by).
X start coordinate (floating-point).
Y start coordinate.
X end coordinate.
Y end coordinate.
Line width in pixels.
Line colour.
Background colour. Default
0x00FFFFFF reads from the display.drawWedgeLine() — Anti-Aliased Tapered Line
aw at the start (ax, ay) to width bw at the end (bx, by), creating a wedge or arrow shape.
X start coordinate.
Y start coordinate.
X end coordinate.
Y end coordinate.
Half-width at the start point.
Half-width at the end point.
Line colour.
Background colour. Default
0x00FFFFFF reads from display.drawBitmap() — Monochrome Bitmap
uint8_t array. Set bits are drawn with fgcolor; clear bits are transparent (overload 1) or drawn with bgcolor (overload 2).
X coordinate of the top-left corner.
Y coordinate of the top-left corner.
Pointer to the bitmap data array (MSB first, row-major).
Bitmap width in pixels.
Bitmap height in pixels.
Colour for set pixels (bit = 1).
Colour for clear pixels (bit = 0). Only in overload 2.
drawXBitmap() — XBM Format Bitmap
drawBitmap()), matching the output of the GIMP XBM export and the standard X11 XBM format.
X coordinate of the top-left corner.
Y coordinate of the top-left corner.
Pointer to XBM format bitmap data (LSB first).
Bitmap width in pixels.
Bitmap height in pixels.
Colour for set bits.
Colour for clear bits. Only in overload 2.