Crate conrod [] [src]

Conrod

An easy-to-use, immediate-mode, 2D GUI library featuring a range of useful widgets.

Reexports

pub use theme::{Align, Theme};

Modules

color

A library providing simple Color and Gradient types along with useful transformations and presets.

drag

Types and functionality related to the dragging behaviour of Widgets.

scroll

Types and functionality related to the scrolling behaviour of widgets.

theme

Types a functionality for handling Canvas and Widget theming.

utils

Various utility functions used throughout Conrod.

Macros

widget_ids!

Generate a list of unique IDs given a list of identifiers.

Structs

Background

A type for drawing a colored window background.

Button

A pressable button widget whose reaction is triggered upon release.

ButtonStyle

Styling for the Button, necessary for constructing its renderable Element.

Canvas

A widget designed to be a parent for other widgets.

CanvasStyle

Describes the style of a Canvas Floating.

CommonBuilder

A struct containing builder data common to all Widget types. This type allows us to do a blanket impl of Positionable and Sizeable for T: Widget.

DrawArgs

Arguments for the Widget::draw method in a struct to simplify the method signature.

DropDownList

Displays a given Vec<String> as a selectable drop down menu. It's reaction is triggered upon selection of a list item.

DropDownListStyle

Styling for the DropDownList, necessary for constructing its renderable Element.

Element

Graphical elements that snap together to build complex widgets and layouts.

EnvelopeEditor

Used for editing a series of 2D Points on a cartesian (X, Y) plane within some given range. Useful for things such as oscillator/automation envelopes or any value series represented periodically.

EnvelopeEditorStyle

Styling for the EnvelopeEditor, necessary for constructing its renderable Element.

GlyphCache

A wrapper over some CharacterCache, exposing it's functionality via a RefCell.

HorizontalAlign

The horizontal alignment of a widget positioned relatively to another UI element on the y axis.

Label

Displays some given text centred within a rectangle.

LabelStyle

The styling for a Label's renderable Element.

Margin

The distance between the dimension bound and the outer edge of the frame.

Mouse

Represents the current state of the Mouse.

MouseButtonState

The current state of a Mouse button.

MouseScroll

The amount of scrolling that has occurred since the last render event.

NumberDialer

A widget for precision control over any digit within a value. The reaction is triggered when the value is updated or if the mouse button is released while the cursor is above the widget.

NumberDialerStyle

Styling for the NumberDialer, necessary for constructing its renderable Element.

Padding

The distance between the inner edge of a frame and the outer edge of the inner content.

Slider

Linear value selection. If the slider's width is greater than it's height, it will automatically become a horizontal slider, otherwise it will be a vertical slider. Its reaction is triggered if the value is updated or if the mouse button is released while the cursor is above the rectangle.

SliderStyle

Styling for the Slider, necessary for constructing its renderable Element.

Split

A type of Canvas for flexibly designing and guiding widget layout as splits of a window.

Tabs

A wrapper around a list of canvasses that displays thema s a list of selectable tabs.

TabsStyle

The styling for Canvas Tabs.

TextBox

A widget for displaying and mutating a given one-line text String. It's reaction is triggered upon pressing of the Enter/Return key.

TextBoxStyle

Styling for the TextBox, necessary for constructing its renderable Element.

Toggle

A pressable widget for toggling the state of a bool. Like the button widget, it's reaction is triggered upon release and will return the new bool state. Note that the toggle will not mutate the bool for you, you should do this yourself within the react closure.

ToggleStyle

Styling for the Toggle, necessary for constructing its renderable Element.

Ui

Ui is the most important type within Conrod and is necessary for rendering and maintaining widget state.

UiCell

A wrapper around a Ui that only exposes the functionality necessary for the Widget::update method. Its primary role is to allow for widget designers to compose their own unique Widgets from other Widgets by calling the Widget::set method within their own Widget's update method. It also provides methods for accessing the Ui's Theme, GlyphCache and UserInput via immutable reference.

UpdateArgs

Arguments for the Widget::update method in a struct to simplify the method signature.

UserInput

A wrapper over the current user input state.

VerticalAlign

The vertical alignment of a widget positioned relatively to another UI element on the x axis.

WidgetId

Unique, public widget identifier. Each widget must use a unique WidgetId so that it's state can be cached within the Ui type. The reason we use a usize is because widgets are cached within a Graph whose max number of Nodes is indexed by usize.

WidgetMatrix

Draw a matrix of any rectangular widget type, where the matrix will provide a function with the widget number, it's rows and cols position, the width and height for the widget and the location at which the widget should be drawn.

WidgetState

Represents the unique cached state of a widget.

XYPad

Used for displaying and controlling a 2D point on a cartesian plane within a given range. Its reaction is triggered when the value is updated or if the mouse button is released while the cursor is above the rectangle.

XYPadStyle

Styling for the XYPad, necessary for constructing its renderable Element.

Enums

Color

Color supporting RGB and HSL variants.

Corner

A corner of a rectangle.

Direction

Directionally positioned, relative to another widget.

Framing

To be used as a parameter for defining the aesthetic of the widget frame.

Horizontal

The orientation of a HorizontalAlign.

JsonIoError

Represents the different kinds of errors returned by Librar.

MouseButtonPosition

Represents the current state of a mouse button.

Place

Place the widget at a position on some other widget.

Position

A cached widget's position for rendering.

Vertical

The orientation of a VerticalAlign.

WidgetIndex

An index either given in the form of a publicly instantiated Widget's WidgetId, or an internally instantiated Widget's NodeIndex,

Traits

CharacterCache

Stores characters in a buffer and loads them by demand.

Colorable

Types that can be colored.

EnvelopePoint

EnvPoint must be implemented for any type that is used as a 2D point within the EnvelopeEditor.

Frameable

Widgets that may display a frame.

Labelable

Widgets that may display some label.

Positionable

Widgets that are positionable.

Sizeable

Widgets that support different dimensions.

Widget

A trait to be implemented by all Widget types.

Functions

align_bottom_of

The y offset required to align an element with height to the bottom of a target element.

align_left_of

The x offset required to align an element with width to the left of a target element.

align_right_of

The x offset required to align an element with width to the right of a target element.

align_top_of

The y offset required to align an element with height to the top of a target element.

bottom_left_of

The position of a rect with dim Dimensions at the bottom left of the target Dimensions.

bottom_right_of

The position of a rect with dim Dimensions at the bottom right of the target Dimensions.

mid_bottom_of

The position of a rect with dim Dimensions at the middle of the inside of the bottom edge of the target Dimensions.

mid_left_of

The position of a rect with dim Dimensions at the middle of the inside of the left edge of the target Dimensions.

mid_right_of

The position of a rect with dim Dimensions at the middle of the inside of the right edge of the target Dimensions.

mid_top_of

The position of a rect with dim Dimensions at the middle of the inside of the top edge of the target Dimensions.

middle_of

The position of a rect with dim Dimensions at the middle of the target Dimensions.

top_left_of

The position of a rect with dim Dimensions at the top left of the target Dimensions.

top_right_of

The position of a rect with dim Dimensions at the top right of the target Dimensions.

Type Definitions

Depth

The depth at which the widget will be rendered. This determines the order of rendering where widgets with a greater depth will be rendered first. 0.0 is the default depth.

Dimensions

General use 2D spatial dimensions.

FontSize

Font size used throughout Conrod.

NodeIndex

An alias for our Graph's Node Index.

Point

General use 2D spatial point.

Scalar