A simple 2D graphics library for turning simple 2D shapes and text into textured triangles.
The left-top corner of the screen is
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.
cintenables interoperability with other color libraries.
color-hex— Enable the
deadlock_detection— This will automatically detect deadlocks due to double-locking on the same thread. If your app freezes, you may want to enable this! Only affects
mutex::RwLock(which epaint and egui uses a lot).
default_fonts(enabled by default) — If set, epaint will use
include_bytes!to bundle some fonts. If you plan on specifying your own fonts you may disable this feature.
extra_debug_asserts— Enable additional checks if debug assertions are enabled (debug builds).
extra_asserts— Always enable additional checks.
log— Turn on the
logfeature, that makes egui log some errors using the
serde— Allow serialization using
unity— Change Vertex layout to be compatible with unity
document-features— Enable this when generating docs.
serde— Allow serialization using
pub use image::ColorImage;
pub use image::FontImage;
pub use image::ImageData;
pub use image::ImageDelta;
pub use stats::PaintStats;
pub use tessellator::tessellate_shapes;
pub use tessellator::TessellationOptions;
pub use tessellator::Tessellator;
pub use text::FontFamily;
pub use text::FontId;
pub use text::Fonts;
pub use text::Galley;
pub use textures::TextureManager;
pub use ahash;
pub use ecolor;
pub use emath;
- Helper module that adds extra checks when the
deadlock_detectionfeature is turned on.
- Collect statistics about what is being painted.
- Converts graphics primitives into textured triangles.
- Everything related to text, fonts, text layout, cursors etc.
- An assert that is only active when
epaintis compiled with the
extra_assertsfeature or with the
extra_debug_assertsfeature in debug builds.
- Construct a
crate::Color32from a hex RGB or RGBA string.
- How to paint a circle.
Shapewithin a clip rectangle.
- This format is used for space-efficient color representation (32 bits).
- A cubic Bézier Curve.
- Hue, saturation, value, alpha. All in the range [0, 1]. No premultiplied alpha.
- Like Hsva but with the
vvalue (brightness) being gamma corrected so that it is somewhat perceptually even.
- Textured triangles in two dimensions.
- A version of
Meshthat uses 16-bit indices.
- If you want to paint some 3D shapes inside an egui region, you can use this.
- A path which can be stroked and/or filled (if closed).
- A position on screen.
- A quadratic Bézier Curve.
- A rectangular region of space.
- How to paint a rectangle.
- 0-1 linear space
RGBAcolor with premultiplied alpha.
- How rounded the corners of things should be
- The color and fuzziness of a fuzzy shape. Can be used for a rectangular shadow with a soft penumbra.
- Describes the width and color of a line.
- How to paint some text on screen.
- Contains font data in an atlas, where each character occupied a small rectangle.
- Used to paint images.
- A vector has a direction and length. A
Vec2is often used to represent a size.
- A paint primitive such as a circle or a piece of text. Coordinates are all screen space points (not physical pixels).
- What texture to use in a
- The UV coordinate of a white region of the texture mesh. The default egui texture has the top-left corner pixel fully white. You need need use a clamping texture sampler for this to work (so it doesn’t do bilinear blending with bottom right corner).
pos2(x, y) == Pos2::new(x, y)
vec2(x, y) == Vec2::new(x, y)