Struct macroquad::ui::Ui[][src]

pub struct Ui {
    pub frame: u64,
    // some fields omitted
}

Fields

frame: u64

Returns the number of frames that have elapsed since the program started.

Implementations

👎 Deprecated:

Use input_text instead

Returns true if the last widget which had .ui called on it is being clicked.

Returns true if the mouse is over the last widget which had .ui called on it.

Scrolls the middle of the active GUI window to its GUI cursor

Note that this does not work on the first frame of the GUI application. If you want your widget to start with its scrollbar in a particular location, consider if ui.frame == 1 { ui.scroll_here() }.

Scrolls the active GUI window to its GUI cursor.

1.0 puts the bottom of the window at the GUI cursor, 0.0 puts the top of the window there.

0.5 as the ratio puts the middle of the window at the GUI cursor, and is equivalent to Ui::scroll_here.

How far the active gui window has been scrolled down on the y axis.

Note that for these purposes, a Group widget is still considered a Window because it can have its own scrollbar.

The farthest down a scrollbar may go given the constraints of its window.

Note that for these purposes, a Group widget is still considered a Window because it can have its own scrollbar.

small hack to keep some internal state used like this:

if ui.last_item_clicked() {
    *ui.get_bool(hash!("color picker opened")) ^= true;
}
if *ui.get_bool(hash!("color picker opened"))  {
}

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.