Module mooeye::ui

source ·
Expand description

Contains the main components for creating UIs.

Modules

  • Contains basic UI contents such as text and images. There is nothing actually here, because the basic elements Text, Image and Empty are created by simply implementing UiContent on ggez’s Text and Image as well as the basic ().
  • Contains UI contents that contain other UI elements, such as vertical boxes and stack boxes.

Structs

  • A struct that contains information about the layout of an UI-Element: their alignment, size, offset and padding.
  • A Transition stuct that can be added to an UiElement to slowly change that elements properties over time. A transition can change the elements layout, visuals, hover_visuals, content and tooltip by first augmenting the transition with the relevant methods.
  • An extension of the ggez::graphics::DrawParam struct specifically for UiElements.
  • A UI element. The entire UI tree of mooeye is built out of these elements. This wrapper struct contains all information about look, layout, tooltip, message handling, etc. of the element, while also containing one UiContent field that contains the actual content.
  • A builder struct for UiElements. Allows changing of all relevant fields of the built element, and contains shorthand function for changing the components of the elements layout. Also contains shorthand functions for some very frequently used combination of layout settings.
  • A struct that describes the additional visual elements of the background added to an element. This background will be drawn first and also contain the padding if any.

Enums

  • An enum that describes the alignment behaviour of an element.
  • An enum that describes the size and growth behaviour of an element.
  • A simple enum that specififes what kind of messages a UI element can send or receive.

Traits