35 releases (23 breaking)

0.31.1 Mar 5, 2025
0.30.0 Dec 16, 2024
0.29.1 Oct 1, 2024
0.28.1 Jul 5, 2024
0.10.0 Feb 28, 2021

#972 in GUI

Download history 54838/week @ 2024-11-22 57540/week @ 2024-11-29 57533/week @ 2024-12-06 60806/week @ 2024-12-13 36594/week @ 2024-12-20 29197/week @ 2024-12-27 53156/week @ 2025-01-03 58642/week @ 2025-01-10 52470/week @ 2025-01-17 52028/week @ 2025-01-24 65890/week @ 2025-01-31 122559/week @ 2025-02-07 134752/week @ 2025-02-14 180223/week @ 2025-02-21 204142/week @ 2025-02-28 160690/week @ 2025-03-07

716,512 downloads per month
Used in 936 crates (24 directly)

MIT/Apache

795KB
13K SLoC

epaint - egui paint library

Latest version Documentation unsafe forbidden MIT Apache

A bare-bones 2D graphics library for turning simple 2D shapes and text into textured triangles.

Made for egui.


lib.rs:

A simple 2D graphics library for turning simple 2D shapes and text into textured triangles.

Made for egui.

Create some Shape:s and pass them to tessellate_shapes to generate Mesh:es that you can then paint using some graphics API of your choice (e.g. OpenGL).

Coordinate system

The left-top corner of the screen is (0.0, 0.0), with X increasing to the right and Y increasing downwards.

epaint uses logical points as its coordinate system. Those related to physical pixels by the pixels_per_point scale factor. For example, a high-dpi screen can have pixels_per_point = 2.0, meaning there are two physical screen pixels for each logical point.

Angles are in radians, and are measured clockwise from the X-axis, which has angle=0.

Feature flags

Dependencies

~2.3–8MB
~64K SLoC