pub struct Gui<'a, T> {
    pub context: &'a mut T,
    /* private fields */
}

Fields§

§context: &'a mut T

Implementations§

source§

impl<'a, T> Gui<'a, T>

source

pub fn layout(&self) -> Rect

source

pub fn pointer(&self) -> Vec2

source

pub fn input_consumed(&self) -> bool

source

pub fn hovers(&self) -> bool

source

pub fn widget<W>(&mut self, widget: W) -> Rectwhere W: GuiWidget<T>,

source

pub fn scope<F>(&mut self, f: F)where F: FnMut(Gui<'_, T>),

source

pub fn clip<F>(&mut self, f: F)where F: FnMut(Gui<'_, T>),

source

pub fn freeform_aligned<F>( &mut self, size: impl Into<Vec2>, alignment: impl Into<Vec2>, pivot: impl Into<Vec2>, f: F ) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn freeform_at<F>( &mut self, size: impl Into<Vec2>, position: impl Into<Vec2>, pivot: impl Into<Vec2>, relative: bool, f: F ) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn growable<F>(&mut self, alignment: impl Into<Vec2>, f: F) -> Rectwhere F: FnMut(Gui<'_, T>) -> Rect,

source

pub fn horizontal_overflow<F>(&mut self, alignment: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>) -> Rect,

source

pub fn vertical_overflow<F>(&mut self, alignment: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>) -> Rect,

source

pub fn scale<F>( &mut self, value: Scalar, alignment: impl Into<Vec2>, f: F ) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn margin<F>( &mut self, left: Scalar, right: Scalar, top: Scalar, bottom: Scalar, f: F ) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn absolute<F>(&mut self, layout: Rect, f: F)where F: FnMut(Gui<'_, T>),

source

pub fn section<F>(&mut self, relative: Rect, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn section_left<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn section_right<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn section_top<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn section_bottom<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn cut_left<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn cut_right<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn cut_top<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn cut_bottom<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn grow_left<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn grow_right<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn grow_top<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn grow_bottom<F>(&mut self, value: Scalar, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn offset<F>(&mut self, value: impl Into<Vec2>, f: F) -> Rectwhere F: FnMut(Gui<'_, T>),

source

pub fn horizontal_number<F>(&mut self, count: usize, f: F)where F: FnMut(Gui<'_, T>, usize),

source

pub fn horizontal_separation<F>(&mut self, value: Scalar, f: F)where F: FnMut(Gui<'_, T>, usize),

source

pub fn vertical_number<F>(&mut self, count: usize, f: F)where F: FnMut(Gui<'_, T>, usize),

source

pub fn vertical_separation<F>(&mut self, value: Scalar, f: F)where F: FnMut(Gui<'_, T>, usize),

source

pub fn grid_number<F>(&mut self, cols: usize, rows: usize, f: F)where F: FnMut(Gui<'_, T>, usize, usize),

source

pub fn grid_separation<F>( &mut self, cell_width: Scalar, cell_height: Scalar, f: F )where F: FnMut(Gui<'_, T>, usize, usize),

source

pub fn sprite(&mut self, name: impl ToString, tint: Rgba)

source

pub fn sprite_region(&mut self, name: impl ToString, tint: Rgba, region: Rect)

source

pub fn sprite_sliced( &mut self, name: impl ToString, tint: Rgba, image_region: Rect, (left, right, top, bottom): (Scalar, Scalar, Scalar, Scalar), frame: bool )

source

pub fn text( &mut self, font: impl ToString, content: impl Into<HaTextContent>, size: Scalar, color: Rgba, alignment: impl Into<Vec2> )

source

pub fn button<F>(&mut self, f: F) -> boolwhere F: FnMut(Gui<'_, T>, bool) -> bool,

source

pub fn gui(&mut self) -> Gui<'_, T>

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for Gui<'a, T>where T: RefUnwindSafe,

§

impl<'a, T> Send for Gui<'a, T>where T: Send,

§

impl<'a, T> Sync for Gui<'a, T>where T: Sync,

§

impl<'a, T> Unpin for Gui<'a, T>

§

impl<'a, T> !UnwindSafe for Gui<'a, T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Finalize for T

§

unsafe fn finalize_raw(data: *mut ())

Safety 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Component for Twhere T: Send + Sync + 'static,