Skip to main content

Frame

Struct Frame 

Source
pub struct Frame<'a> { /* private fields */ }
Expand description

A frame of the debug UI, from DebugUi::frame: its windows are filled, then Frame::finish pushes what they draw. Dropped, it ends the frame: a frame not finished draws nothing, and its input is spent.

Implementations§

Source§

impl Frame<'_>

Source

pub fn window( &mut self, title: impl Display, first: Rect, add: impl FnOnce(&mut Ui<'_>), ) -> bool

A window titled title, filled by add, which is not called while the window is collapsed. Returns whether it is open: not collapsed.

  • It shows at first the first time, unless a place was set for it (DebugUi::set_place), and keeps its place after.
  • It is drawn in front of the windows already open, and comes to the front when it is pressed.
  • Its title bar drags it, kept at least partly on screen, and its box on the left collapses it; the grip at its bottom-right corner resizes it; when its content is taller than it, the wheel over it or its scrollbar’s thumb scrolls it. A drag starts from where it is drawn, which is its place moved on screen if it was off it.
  • "Title##key" shows Title and is the window key, whose place is kept as the title changes. A second call of one window in a frame continues its content.
  • With no output to draw on (a size of 0), nothing is shown.
Source

pub fn finish(self, out: &mut UiList)

Pushes what the frame’s windows draw into out (RenderFrame::ui), window by window from back to front, an open combo’s list last: in the top layer at the last depth (SortMode::Fixed(u32::MAX)), at the style’s scale, each cut to its window. Call it after the game’s UI is pushed, which then draws behind it. The list’s view is put back as it was.

Trait Implementations§

Source§

impl Drop for Frame<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Frame<'a>

§

impl<'a> !Send for Frame<'a>

§

impl<'a> !Sync for Frame<'a>

§

impl<'a> !UnwindSafe for Frame<'a>

§

impl<'a> Forget for Frame<'a>

§

impl<'a> Freeze for Frame<'a>

§

impl<'a> Move for Frame<'a>

§

impl<'a> Unpin for Frame<'a>

§

impl<'a> UnsafeUnpin for Frame<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.