#graphics #egui

epaint

Minimal 2D graphics library for GUI work

16 breaking releases

new 0.24.1 Nov 30, 2023
0.23.0 Sep 28, 2023
0.22.0 May 23, 2023
0.21.0 Feb 8, 2023
0.10.0 Feb 28, 2021

#65 in GUI

Download history 25254/week @ 2023-08-11 23637/week @ 2023-08-18 24904/week @ 2023-08-25 23452/week @ 2023-09-01 26121/week @ 2023-09-08 23521/week @ 2023-09-15 19407/week @ 2023-09-22 26430/week @ 2023-09-29 28244/week @ 2023-10-06 29136/week @ 2023-10-13 29157/week @ 2023-10-20 31462/week @ 2023-10-27 27706/week @ 2023-11-03 30436/week @ 2023-11-10 33140/week @ 2023-11-17 24146/week @ 2023-11-24

121,722 downloads per month
Used in 491 crates (19 directly)

(MIT OR Apache-2…

1MB
10K 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 screeen 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

~1.8–8MB
~51K SLoC