Expand description
EGUI integration interface
Dotrix provides a simple example demonstrating the EGUI integration.
Modules§
- any
- Any-type storages for
Memory. - containers
- Containers are pieces of the UI which wraps other pieces of UI. Examples:
Window,ScrollArea,Resize,SidePanel, etc. - epaint
- 2D graphics/rendering. Fonts, textures, color, geometry, tessellation etc.
- layers
- Handles paint layers, i.e. how things are sometimes painted behind or in front of other things.
- menu
- Menu bar functionality (very basic so far).
- output
- All the data egui returns to the backend at the end of each frame.
- special_
emojis - egui supports around 1216 emojis in total. Here are some of the most useful: ∞⊗⎗⎘⎙⏏⏴⏵⏶⏷ ⏩⏪⏭⏮⏸⏹⏺■▶📾🔀🔁🔃 ☀☁★☆☐☑☜☝☞☟⛃⛶✔ ↺↻⟲⟳⬅➡⬆⬇⬈⬉⬊⬋⬌⬍⮨⮩⮪⮫ ♡ 📅📆 📈📉📊 📋📌📎📤📥🔆 🔈🔉🔊🔍🔎🔗🔘 🕓🖧🖩🖮🖱🖴🖵🖼🗀🗁🗋🗐🗑🗙🚫❓
- style
- egui theme (spacing, colors, etc).
- util
- Miscellaneous tools used by the rest of egui.
- widgets
- Widgets are pieces of GUI such as
Label,Button,Slideretc.
Macros§
- egui_
assert - An assert that is only active when
eguiis compiled with theegui_assertfeature or with thedebug_egui_assertfeature in debug builds. - github_
link_ file - Create a
Hyperlinkto the currentfile!()on github. - github_
link_ file_ line - Create a
Hyperlinkto the currentfile!()(and line) on Github - trace
- Show debug info on hover when
Context::set_debug_on_hoverhas been turned on.
Structs§
- Align2
- Two-dimension alignment, e.g.
Align2::LEFT_TOP. - Area
- An area on the screen that can be moved by dragging.
- Central
Panel - A panel that covers the remainder of the screen, i.e. whatever area is left after adding other panels.
- Checkbox
- Boolean on/off control with text label.
- Clipped
Mesh - A
Meshwithin a clip rectangle. - Collapsing
Header - A header which can be collapsed/expanded, revealing a contained
Uiregion. - Collapsing
Response - The response from showing a
CollapsingHeader. - Color32
- This format is used for space-efficient color representation (32 bits).
- Combo
Box - A drop-down selection menu with a descriptive label.
- Context
- This is the first thing you need when working with egui. Create using
CtxRef. - CtxRef
- A wrapper around
Arc<Context>. This is how you will normally create and access aContext. - Cursor
Pair - Drag
Value - A numeric value that you can change by dragging the number. More compact than a
Slider. - Dropped
File - A file dropped into egui.
- Egui
- EGUI overlay provider
- Font
Definitions - Describes the font data and the sizes to use.
- Frame
- Color and margin of a rectangular background of a
Ui. - Grid
- A simple grid layout.
- Hovered
File - A file about to be dropped into egui.
- Hyperlink
- A clickable hyperlink, e.g. to
"https://github.com/emilk/egui". - Image
- An widget to show an image of a given size.
- Image
Button - A clickable image within a frame.
- Inner
Response - Returned when we wrap some ui-code and want to return both the results of the inner function and the ui as a whole, e.g.:
- Label
- Static text.
- LayerId
- An identifier for a paint layer.
Also acts as an identifier for
Area:s. - Layout
- The layout of a
Ui, e.g. “vertical & centered”. - Memory
- The data that egui persists between frames.
- Multi
Touch Info - All you probably need to know about a multi-touch gesture.
- Output
- What egui emits each frame. The backend should use this.
- Painter
- Helper to paint shapes and text to a specific region on a specific layer.
- Pointer
State - Mouse or touch state.
- Pos2
- A position on screen.
- Progress
Bar - A simple progress bar.
- Radio
Button - One out of several alternatives, either selected or not.
- RawInput
- What the integrations provides to egui at the start of each frame.
- Rect
- A rectangular region of space.
- Resize
- A region that can be resized by dragging the bottom right corner.
- Response
- The result of adding a widget to a
Ui. - Rgba
- 0-1 linear space
RGBAcolor with premultiplied alpha. - Scroll
Area - Add vertical scrolling to a contained
Ui. - Selectable
Label - One out of several alternatives, either selected or not.
Will mark selected items with a different background color.
An alternative to
RadioButtonandCheckbox. - Sense
- What sort of interaction is a widget sensitive to?
- Separator
- A visual separator. A horizontal or vertical line (depending on
Layout). - Side
Panel - A panel that covers the entire left or right side of a
Uior screen. - Slider
- Control a number by a horizontal slider.
- Stroke
- Describes the width and color of a line.
- Style
- Specifies the look and feel of egui.
- Text
Edit - A text region that the user can edit the contents of.
- TopBottom
Panel - A panel that covers the entire top or bottom of a
Uior screen. - TopPanel
Deprecated - Touch
Device Id - this is a
u64as values of this kind can always be obtained by hashing - TouchId
- Unique identification of a touch occurrence (finger or pen or …). A Touch ID is valid until the finger is lifted. A new ID is used for the next touch.
- Vec2
- A vector has a direction and length.
A
Vec2is often used to represent a size. - Visuals
- Controls the visual style (colors etc) of egui.
- Widget
Info - Describes a widget such as a
crate::Buttonor acrate::TextEdit.
Enums§
- Align
- left/center/right or top/center/bottom alignment for e.g. anchors and layouts.
- Cursor
Icon - A mouse cursor icon.
- Direction
- Layout direction, one of
LeftToRight,RightToLeft,TopDown,BottomUp. - Event
- An input event generated by the integration.
- Font
Family - Which style of font:
MonospaceorProportional. - Key
- Keyboard keys.
- Order
- Different layer categories
- Pointer
Button - Mouse button (or similar for touch input)
- 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
Meshmesh. - Touch
Phase - In what phase a touch event is in.
- Widget
Type - The different types of built-in widgets in egui
Constants§
- NUM_
POINTER_ BUTTONS - Number of pointer buttons supported by egui, i.e. the number of possible states of
PointerButton.
Traits§
- NumExt
- Extends
f32,Vec2etc withat_leastandat_mostas aliases formaxandmin. - Text
Buffer - Trait constraining what types
TextEditmay use as an underlying buffer.
Functions§
- combo_
box_ with_ label Deprecated - A drop-down selection menu with a descriptive label.
- extension
- Enables EGUI extension into Dotrix application
- lerp
- Linear interpolation.
- popup_
below_ widget - Shows a popup below another widget.
- 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 thetorange. - reset_
button - Show a button to reset a value to its default. The button is only enabled if the value does not already have its original value.
- show_
tooltip - Show a tooltip at the current pointer position (if any).
- show_
tooltip_ at - Show a tooltip at the given position.
- show_
tooltip_ at_ pointer - Show a tooltip at the current pointer position (if any).
- show_
tooltip_ text - Show some text at the current pointer position (if any).
- show_
tooltip_ under - Show a tooltip under the given area.
- startup
- EGUI overlay startup system
- stroke_
ui - vec2
vec2(x,y) == Vec2::new(x, y)- warn_
if_ debug_ build - Helper function that adds a label when compiling with debug assertions enabled.