32 releases (21 breaking)

0.29.1 Oct 1, 2024
0.28.1 Jul 5, 2024
0.27.1 Mar 29, 2024
0.24.1 Nov 30, 2023
0.10.0 Feb 28, 2021

#938 in GUI

Download history 40810/week @ 2024-07-20 40334/week @ 2024-07-27 39773/week @ 2024-08-03 47653/week @ 2024-08-10 38832/week @ 2024-08-17 44577/week @ 2024-08-24 42185/week @ 2024-08-31 38516/week @ 2024-09-07 33075/week @ 2024-09-14 41676/week @ 2024-09-21 45005/week @ 2024-09-28 44681/week @ 2024-10-05 52086/week @ 2024-10-12 49196/week @ 2024-10-19 52700/week @ 2024-10-26 59070/week @ 2024-11-02

220,166 downloads per month
Used in 823 crates (22 directly)

MIT/Apache

750KB
12K 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–8MB
~65K SLoC