Struct nannou::ui::Ui [] [src]

pub struct Ui {
    pub image_map: Map<Texture2d>,
    // some fields omitted
}

A handle to the Ui for a specific window.

Fields

Methods

impl Ui
[src]

DEFAULT_PENDING_INPUT_LIMIT: usize = 1024

The default maximum number of Inputs that a Ui will store in its pending Input queue before Inputs start being ignored.

DEFAULT_FONT_PATH: &'static str = "fonts/NotoSans/NotoSans-Regular.ttf"

The path to the default font for the Ui.

[src]

Generate a new, unique widget::Id into a Placeholder node within the widget graph. This should only be called once for each unique widget needed to avoid unnecessary bloat within the Ui's internal widget graph.

When using this method, be sure to store the returned widget::Id somewhere so that it can be re-used on next update.

Panics if adding another node would exceed the maximum capacity for node indices.

[src]

Produces the type that may be used to generate new unique widget::Ids.

[src]

Handle a raw UI input event and update the Ui state accordingly.

This method drives the Ui forward and interprets input into higher-level events (like clicks and drags) for widgets.

Note: By default, this will be called automatically by the nannou App, so most of the time you should not need to call this (otherwise received inputs may double up). This method is particularly useful in the case that automatic input handling has been disabled, as this can be used to manually submit inputs.

[src]

Processes all pending input.

This is automatically called at the beginning of the set_widgets method, so the user should never need to call this manually, however the method is exposed for flexibility just in case.

This has no effect if automatic input handling is disabled.

[src]

Returns a context upon which UI widgets can be instantiated.

The UiCell simply acts as a wrapper around the Ui for the period over which widgets are instantiated. Once the UiCell is dropped, it does some cleanup and sorting that is required after widget instantiation.

[src]

Mutable access to the Ui's font map.

This allows for adding and removing fonts to the UI.

[src]

Mutable access to the Ui's Theme.

This allows for making changes to the active theme.

[src]

The first of the Primitives yielded by Ui::draw will always be a Rectangle the size of the window in which the Ui is instantiated.

This method sets the colour with which this Rectangle is drawn (the default being color::TRANSPARENT).

[src]

Draws the current state of the Ui to the given Frame.

The Ui will automatically draw to its associated window within the given Frame.

If you require more control over where the Ui is drawn within the Frame, the draw method offers more flexibility.

This has no effect if the window originally associated with the Ui no longer exists.

Methods from Deref<Target = Ui>

[src]

Returns a input::Widget for the given widget

[src]

The Rect for the widget at the given index.

Returns None if there is no widget for the given index.

[src]

The absolute width of the widget at the given index.

Returns None if there is no widget for the given index.

[src]

The absolute height of the widget at the given index.

Returns None if there is no widget for the given index.

[src]

The absolute dimensions for the widget at the given index.

Returns None if there is no widget for the given index.

[src]

The coordinates for the widget at the given index.

Returns None if there is no widget for the given index.

[src]

The kid_area of the widget at the given index.

Returns None if there is no widget for the given index.

[src]

An index to the previously updated widget if there is one.

[src]

Borrow the Ui's widget_graph.

[src]

Borrow the Ui's set of updated widgets.

This set indicates which widgets have been instantiated since the beginning of the most recent Ui::set_widgets call.

[src]

Borrow the Ui's set of updated widgets.

This set indicates which widgets have were instantiated during the previous call to Ui::set_widgets.

[src]

Get an immutable reference to global input. Handles aggregation of events and providing them to Widgets

Can be used to access the current input state, e.g. which widgets are currently capturing inputs.

[src]

Get the centred xy coords for some given Dimensions, Position and alignment.

If getting the xy for a specific widget, its widget::Id should be specified so that we can also consider the scroll offset of the scrollable parent widgets.

The place_on_kid_area argument specifies whether or not Place Position variants should target a Widget's kid_area, or simply the Widget's total area.

[src]

Tells the Ui that it needs to re-draw everything. It does this by setting the redraw count to num_redraw_frames. See the docs for set_num_redraw_frames, SAFE_REDRAW_COUNT or draw_if_changed for more info on how/why the redraw count is used.

[src]

Draw the Ui in it's current state.

NOTE: If you don't need to redraw your conrod GUI every frame, it is recommended to use the Ui::draw_if_changed method instead.

[src]

The Rect that bounds the kids of the widget with the given index.

[src]

The Rect that represents the maximum fully visible area for the widget with the given index, including consideration of cropped scroll area.

Otherwise, return None if the widget is not visible.

[src]

Get mouse cursor state.

Trait Implementations

impl Deref for Ui
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

Auto Trait Implementations

impl !Send for Ui

impl !Sync for Ui