Crate hui

Crate hui 

Source
Expand description

Simple UI library for games and other interactive applications

§Features

  • derive (enabled by default) — Enable derive macros
  • image (enabled by default) — Enable image loading support using the image crate
  • builtin_font (enabled by default) — Enable the built-in font (ProggyTiny, adds 35kb to the executable)
§Pixel-perfect rendering:
  • pixel_perfect — Round all vertex positions to nearest integer coordinates (not recommended)
  • pixel_perfect_text (enabled by default) — Apply pixel-perfect rendering hack to text (fixes blurry text rendering)

Make sure to disable both features if you are not rendering UI “as-is” at 1:1 scale
For exmaple, you should disable them if using DPI (or any other form of) scaling while passing the virtual resolution to the ui or rendering it in 3d space

§Built-in elements:
  • el_all (enabled by default) — Enable all built-in elements
  • el_container (enabled by default) — Enable the built-in Container element
  • el_frame_view (enabled by default) — Enable the built-in FrameView element
  • el_spacer (enabled by default) — Enable the built-in Spacer element
  • el_br (enabled by default) — Enable the built-in Break element
  • el_text (enabled by default) — Enable the built-in Text element
  • el_image (enabled by default) — Enable the built-in Image element
  • el_progress_bar (enabled by default) — Enable the built-in ProgressBar element
  • el_slider (enabled by default) — Enable the built-in Slider element
  • el_transformer (enabled by default) — Enable the built-in Transformer element
  • el_interactable (enabled by default) — Enable the built-in Interactable element

Modules§

color
various predefined color constants and helper functions
draw
draw commands, tesselation and UI rendering.
element
element API and built-in elements like Container, Button, Text, etc.
event
input, window events and event handling
frame
modular procedural background system
input
keyboard, mouse, and touch input handling
layout
element layout, alignment and sizing
measure
element measurement, hints and responses
rect
contains types which represent the sides and corners of a rectangular shape.
signal
signal handling for UI events
state
state managment for stateful elements
text
text rendering, styling, measuring

Macros§

rect_frame
Helper macro for constructing a RectFrame
size
Constructs a Size or Size2d from a literal or expression

Structs§

UiInstance
The main instance of the UI system.