34 releases (breaking)

0.31.0 Feb 4, 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

#1023 in GUI

Download history 53234/week @ 2024-10-30 54545/week @ 2024-11-06 51749/week @ 2024-11-13 54874/week @ 2024-11-20 57811/week @ 2024-11-27 56761/week @ 2024-12-04 61267/week @ 2024-12-11 49459/week @ 2024-12-18 26623/week @ 2024-12-25 43982/week @ 2025-01-01 53142/week @ 2025-01-08 58774/week @ 2025-01-15 52276/week @ 2025-01-22 57972/week @ 2025-01-29 79501/week @ 2025-02-05 126510/week @ 2025-02-12

323,499 downloads per month
Used in 919 crates (23 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.1–8MB
~63K SLoC