Crate bevy_retrograde_epaint[][src]

Expand description

Bevy Retrograde epaint integration

The target use-case is easy drawing of primitives such as lines, circles, text, etc. for use in debug rendering and visualization.


AHash is a hashing algorithm is intended to be a high performance, (hardware specific), keyed hash function. This can be seen as a DOS resistant alternative to FxHash, or a fast equivalent to SipHash. It provides a high speed hash algorithm, but where the result is not predictable without knowing a Key. This allows it to be used in a HashMap without allowing for the possibility that an malicious user can induce a collision.

One- and two-dimensional alignment (Align::Center, Align2::LEFT_TOP etc).

Color conversions and types.

Opinionated 2D math library for building GUIs.

Helper module that wraps some Mutex types with different implementations.

Epaint plugin prelude

Find “simple” numbers is some range. Used by sliders.

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 egui is compiled with the egui_assert feature or with the debug_egui_assert feature in debug builds.

An assert that is only active when egui is compiled with the egui_assert feature or with the debug_egui_assert feature in debug builds.


Two-dimension alignment, e.g. Align2::LEFT_TOP.

A Mesh within a clip rectangle.

A Shape within a clip rectangle.

This format is used for space-efficient color representation (32 bits).

A collection of text locked into place.

Textured triangles in two dimensions.

A version of Mesh that uses 16-bit indices.

Collected allocation statistics for shapes and meshes.

A position on screen.

A rectangular region of space.

Linearly transforms positions from one Rect to another.

Text rendering plugin for Bevy Retrograde

0-1 linear space RGBA color with premultiplied alpha.

Represents a rotation in the 2D plane. A rotation of 𝞃/4 = 90° rotates the X axis to the Y axis. Normally a Rot2 is normalized (unit-length). If not, it will also scale vectors.

The color and fuzziness of a fuzzy shape. Can be used for a rectangular shadow with a soft penumbra.

Bundle for rendering an epaint shape

Describes the width and color of a line.

Tessellation quality options

Converts Shapes into Mesh.

An 8-bit texture containing font data.

Contains font data in an atlas, where each character occupied a small rectangle.

A vector has a direction and length. A Vec2 is often used to represent a size.

The 2D vertex type.


left/center/right or top/center/bottom alignment for e.g. anchors and layouts.

A paint primitive such as a circle or a piece of text. Coordinates are all screen space points (not physical pixels).

One of a few categories of styles of text, e.g. body, button or heading.

What texture to use in a Mesh mesh.


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).


Extends f32, Vec2 etc with at_least and at_most as aliases for max and min.

Implemented for all builtin numeric types

Helper trait to implement lerp and remap.

Helper trait to implement lerp and remap.


Return true when arguments are the same within some rounding error.


Returns range.start() if x <= range.start(), returns range.end() if x >= range.end() and returns x elsewhen.

Linear interpolation.

Wrap angle to [-PI, PI] range.

pos2(x,y) == Pos2::new(x, y)

Linearly remap a value from one range to another, so that when x == from.start() returns to.start() and when x == from.end() returns to.end().

Like remap, but also clamps the value so that the returned value is always in the to range.

Round a value to the given number of decimal places.

vec2(x,y) == Vec2::new(x, y)