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.
Modules§
- ahash
- 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 toSipHash
. 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 aHashMap
without allowing for the possibility that an malicious user can induce a collision. - align
- One- and two-dimensional alignment (
Align::Center
,Align2::LEFT_TOP
etc). - color
- Color conversions and types.
- emath
- Opinionated 2D math library for building GUIs.
- mutex
- Helper module that wraps some Mutex types with different implementations.
- prelude
- Epaint plugin prelude
- shape_
transform - smart_
aim - Find “simple” numbers is some range. Used by sliders.
- stats
- Collect statistics about what is being painted.
- tessellator
- Converts graphics primitives into textured triangles.
- text
- Everything related to text, fonts, text layout, cursors etc.
Macros§
- emath_
assert - An assert that is only active when
egui
is compiled with theegui_assert
feature or with thedebug_egui_assert
feature in debug builds. - epaint_
assert - An assert that is only active when
egui
is compiled with theegui_assert
feature or with thedebug_egui_assert
feature in debug builds.
Structs§
- Align2
- Two-dimension alignment, e.g.
Align2::LEFT_TOP
. - Clipped
Mesh - A
Mesh
within a clip rectangle. - Clipped
Shape - A
Shape
within a clip rectangle. - Color32
- This format is used for space-efficient color representation (32 bits).
- Galley
- A collection of text locked into place.
- Mesh
- Textured triangles in two dimensions.
- Mesh16
- A version of
Mesh
that uses 16-bit indices. - Paint
Stats - Collected allocation statistics for shapes and meshes.
- Pos2
- A position on screen.
- Rect
Transform - Linearly transforms positions from one
Rect
to another. - Retro
Epaint Plugin - Text rendering plugin for Bevy Retrograde
- Rgba
- 0-1 linear space
RGBA
color with premultiplied alpha. - Rot2
- 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. - Shadow
- The color and fuzziness of a fuzzy shape. Can be used for a rectangular shadow with a soft penumbra.
- Shape
Bundle - Bundle for rendering an
epaint
shape - Stroke
- Describes the width and color of a line.
- Tessellation
Options - Tessellation quality options
- Tessellator
- Converts
Shape
s intoMesh
. - Texture
- An 8-bit texture containing font data.
- Texture
Atlas - Contains font data in an atlas, where each character occupied a small rectangle.
- Vertex
- The 2D vertex type.
Enums§
- Align
- left/center/right or top/center/bottom alignment for e.g. anchors and layouts.
- Shape
- A paint primitive such as a circle or a piece of text. Coordinates are all screen space points (not physical pixels).
- Text
Style - One of a few categories of styles of text, e.g. body, button or heading.
- Texture
Id - What texture to use in a
Mesh
mesh.
Constants§
- WHITE_
UV - 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).
Traits§
- NumExt
- Extends
f32
,Vec2
etc withat_least
andat_most
as aliases formax
andmin
. - Numeric
- Implemented for all builtin numeric types
- One
- Helper trait to implement
lerp
andremap
. - Real
- Helper trait to implement
lerp
andremap
.
Functions§
- almost_
equal - Return true when arguments are the same within some rounding error.
- clamp
Deprecated - Returns
range.start()
ifx <= range.start()
, returnsrange.end()
ifx >= range.end()
and returnsx
elsewhen. - format_
with_ decimals_ in_ range - format_
with_ minimum_ decimals - lerp
- Linear interpolation.
- normalized_
angle - Wrap angle to
[-PI, PI]
range. - pos2
pos2(x,y) == Pos2::new(x, y)
- remap
- Linearly remap a value from one range to another,
so that when
x == from.start()
returnsto.start()
and whenx == from.end()
returnsto.end()
. - remap_
clamp - Like
remap
, but also clamps the value so that the returned value is always in theto
range. - round_
to_ decimals - Round a value to the given number of decimal places.
- vec2
vec2(x,y) == Vec2::new(x, y)