Window

Struct Window 

Source
pub struct Window {
    pub pos: UiValue<Vec2>,
    pub anchor: Anchor,
    pub size: UiValue<Vec2>,
}
Expand description

Window - Declarative layout type that is defined by its size and position. Nodes with this layout are not included in the ui flow.

ยง๐Ÿ› ๏ธ Example

let layout: UiLayout = Window::new().pos(Ab(100.0)).size(Rl(50.0)).pack();

Fieldsยง

ยงpos: UiValue<Vec2>

Position of the node.

ยงanchor: Anchor

Decides where position should be applied at.

ยงsize: UiValue<Vec2>

Size of the node layout.

Implementationsยง

Sourceยง

impl Window

Source

pub const fn new() -> Self

Creates new empty Window node layout.

Source

pub fn full() -> Self

Creates new full Window node layout.

Source

pub fn pos(self, pos: impl Into<UiValue<Vec2>>) -> Self

Replaces the position with a new value.

Source

pub fn x(self, x: impl Into<UiValue<f32>>) -> Self

Replaces the x position with a new value.

Source

pub fn y(self, y: impl Into<UiValue<f32>>) -> Self

Replaces the y position with a new value.

Source

pub fn size(self, size: impl Into<UiValue<Vec2>>) -> Self

Replaces the size with a new value.

Source

pub fn width(self, width: impl Into<UiValue<f32>>) -> Self

Replaces the width with a new value.

Source

pub fn height(self, height: impl Into<UiValue<f32>>) -> Self

Replaces the height with a new value.

Source

pub fn anchor(self, anchor: impl Into<Anchor>) -> Self

Replaces the anchor with a new value.

Source

pub fn set_pos(&mut self, pos: impl Into<UiValue<Vec2>>)

Sets the position to a new value.

Source

pub fn set_x(&mut self, x: impl Into<UiValue<f32>>)

Sets the x position to a new value.

Source

pub fn set_y(&mut self, y: impl Into<UiValue<f32>>)

Sets the y position to a new value.

Source

pub fn set_size(&mut self, size: impl Into<UiValue<Vec2>>)

Sets the size to a new value.

Source

pub fn set_width(&mut self, width: impl Into<UiValue<f32>>)

Sets the width to a new value.

Source

pub fn set_height(&mut self, height: impl Into<UiValue<f32>>)

Sets the height to a new value.

Source

pub fn set_anchor(&mut self, anchor: impl Into<Anchor>)

Sets the anchor to a new value.

Source

pub fn package(self) -> Layout

Packs the struct into Layout.

Trait Implementationsยง

Sourceยง

impl Clone for Window

Sourceยง

fn clone(&self) -> Window

Returns a duplicate of the value. Read more
1.0.0ยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Debug for Window

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl Default for Window

Sourceยง

fn default() -> Window

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl From<Window> for Layout

Sourceยง

fn from(val: Window) -> Self

Converts to this type from the input type.
Sourceยง

impl FromReflect for Window
where Self: Any + Send + Sync, UiValue<Vec2>: FromReflect + TypePath + RegisterForReflection, Anchor: FromReflect + TypePath + RegisterForReflection,

Sourceยง

fn from_reflect(reflect: &dyn Reflect) -> Option<Self>

Constructs a concrete instance of Self from a reflected value.
Sourceยง

fn take_from_reflect( reflect: Box<dyn Reflect>, ) -> Result<Self, Box<dyn Reflect>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
Sourceยง

impl GetTypeRegistration for Window
where Self: Any + Send + Sync, UiValue<Vec2>: FromReflect + TypePath + RegisterForReflection, Anchor: FromReflect + TypePath + RegisterForReflection,

Sourceยง

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.
Sourceยง

fn register_type_dependencies(registry: &mut TypeRegistry)

Registers other types needed by this type. Read more
Sourceยง

impl NiceDisplay for Window

Sourceยง

fn to_nicestr(&self) -> String

Output the data in a formatted string using the colorise crate.
Sourceยง

impl PartialEq for Window

Sourceยง

fn eq(&self, other: &Window) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0ยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl Reflect for Window
where Self: Any + Send + Sync, UiValue<Vec2>: FromReflect + TypePath + RegisterForReflection, Anchor: FromReflect + TypePath + RegisterForReflection,

Sourceยง

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
Sourceยง

fn into_any(self: Box<Self>) -> Box<dyn Any>

Returns the value as a Box<dyn Any>.
Sourceยง

fn as_any(&self) -> &dyn Any

Returns the value as a &dyn Any.
Sourceยง

fn as_any_mut(&mut self) -> &mut dyn Any

Returns the value as a &mut dyn Any.
Sourceยง

fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>

Casts this type to a boxed reflected value.
Sourceยง

fn as_reflect(&self) -> &dyn Reflect

Casts this type to a reflected value.
Sourceยง

fn as_reflect_mut(&mut self) -> &mut dyn Reflect

Casts this type to a mutable reflected value.
Sourceยง

fn clone_value(&self) -> Box<dyn Reflect>

Clones the value as a Reflect trait object. Read more
Sourceยง

fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
Sourceยง

fn try_apply(&mut self, value: &dyn Reflect) -> Result<(), ApplyError>

Tries to apply a reflected value to this value. Read more
Sourceยง

fn reflect_kind(&self) -> ReflectKind

Returns a zero-sized enumeration of โ€œkindsโ€ of type. Read more
Sourceยง

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an immutable enumeration of โ€œkindsโ€ of type. Read more
Sourceยง

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of โ€œkindsโ€ of type. Read more
Sourceยง

fn reflect_owned(self: Box<Self>) -> ReflectOwned

Returns an owned enumeration of โ€œkindsโ€ of type. Read more
Sourceยง

fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>

Returns a โ€œpartial equalityโ€ comparison result. Read more
Sourceยง

fn apply(&mut self, value: &(dyn Reflect + 'static))

Applies a reflected value to this value. Read more
Sourceยง

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
Sourceยง

fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Debug formatter for the value. Read more
Sourceยง

fn serializable(&self) -> Option<Serializable<'_>>

Returns a serializable version of the value. Read more
Sourceยง

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
Sourceยง

impl Struct for Window
where Self: Any + Send + Sync, UiValue<Vec2>: FromReflect + TypePath + RegisterForReflection, Anchor: FromReflect + TypePath + RegisterForReflection,

Sourceยง

fn field(&self, name: &str) -> Option<&dyn Reflect>

Returns a reference to the value of the field named name as a &dyn Reflect.
Sourceยง

fn field_mut(&mut self, name: &str) -> Option<&mut dyn Reflect>

Returns a mutable reference to the value of the field named name as a &mut dyn Reflect.
Sourceยง

fn field_at(&self, index: usize) -> Option<&dyn Reflect>

Returns a reference to the value of the field with index index as a &dyn Reflect.
Sourceยง

fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>

Returns a mutable reference to the value of the field with index index as a &mut dyn Reflect.
Sourceยง

fn name_at(&self, index: usize) -> Option<&str>

Returns the name of the field with index index.
Sourceยง

fn field_len(&self) -> usize

Returns the number of fields in the struct.
Sourceยง

fn iter_fields(&self) -> FieldIter<'_>

Returns an iterator over the values of the reflectable fields for this struct.
Sourceยง

fn clone_dynamic(&self) -> DynamicStruct

Clones the struct into a DynamicStruct.
Sourceยง

impl TypePath for Window
where Self: Any + Send + Sync,

Sourceยง

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Sourceยง

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
Sourceยง

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
Sourceยง

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Sourceยง

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Sourceยง

impl Typed for Window
where Self: Any + Send + Sync, UiValue<Vec2>: FromReflect + TypePath + RegisterForReflection, Anchor: FromReflect + TypePath + RegisterForReflection,

Sourceยง

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
Sourceยง

impl Copy for Window

Sourceยง

impl StructuralPartialEq for Window

Auto Trait Implementationsยง

Blanket Implementationsยง

ยง

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

ยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Sourceยง

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
ยง

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

ยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
ยง

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

ยง

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

Mutably borrows from an owned value. Read more
ยง

impl<T> CloneToUninit for T
where T: Clone,

ยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> Downcast<T> for T

Sourceยง

impl<T> Downcast for T
where T: Any,

Sourceยง

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Sourceยง

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Sourceยง

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Anyโ€™s vtable from &Traitโ€™s.
Sourceยง

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Anyโ€™s vtable from &mut Traitโ€™s.
Sourceยง

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Sourceยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Sourceยง

impl<T> DynamicTypePath for T
where T: TypePath,

ยง

impl<T> From<T> for T

ยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> FromWorld for T
where T: Default,

Sourceยง

fn from_world(_world: &mut World) -> T

Creates Self using data from the given World.
Sourceยง

impl<S> GetField for S
where S: Struct,

Sourceยง

fn get_field<T>(&self, name: &str) -> Option<&T>
where T: Reflect,

Returns a reference to the value of the field named name, downcast to T.
Sourceยง

fn get_field_mut<T>(&mut self, name: &str) -> Option<&mut T>
where T: Reflect,

Returns a mutable reference to the value of the field named name, downcast to T.
Sourceยง

impl<T> GetPath for T
where T: Reflect + ?Sized,

Sourceยง

fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
Sourceยง

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
Sourceยง

fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
Sourceยง

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
Sourceยง

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Sourceยง

const WITNESS: W = W::MAKE

A constant of the type witness
Sourceยง

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

Sourceยง

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Sourceยง

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
ยง

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

ยง

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> ToOwned for T
where T: Clone,

ยง

type Owned = T

The resulting type after obtaining ownership.
ยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
ยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
ยง

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

ยง

type Error = Infallible

The type returned in the event of a conversion error.
ยง

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

Performs the conversion.
ยง

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

ยง

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

The type returned in the event of a conversion error.
ยง

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

Performs the conversion.
Sourceยง

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Sourceยง

impl<T> Upcast<T> for T

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<T> ConditionalSend for T
where T: Send,

Sourceยง

impl<T> Settings for T
where T: 'static + Send + Sync,

Sourceยง

impl<T> WasmNotSend for T
where T: Send,

Sourceยง

impl<T> WasmNotSendSync for T

Sourceยง

impl<T> WasmNotSync for T
where T: Sync,