Struct bevy_ui_navigation::Focusable
source · [−]pub struct Focusable { /* private fields */ }Expand description
An Entity
that can be navigated to using the ui navigation system.
It is in one of multiple FocusState, you can check its state with
the Focusable::state method or any of the is_* Focusable methods.
A Focusable can be Focusable::cancel. Meaning: when you send the
NavRequest::Action request while a cancel Focusable is focused,
it will act as if the NavRequest::Cancel request was received.
A Focusable can also be Focusable::lock. Meaning: when you send the
NavRequest::Action request while a lock Focusable is focused,
it will prevent all further processing of NavRequests and emit a
NavEvent::Locked.
Only by sending a NavRequest::Free will the navigation system resume
processing new NavRequests. It will send a NavEvent::Unlocked just
before.
Implementations
The state of this Focusable
This Focusable is the unique focused element
All navigation requests start from it.
To set an arbitrary Focusable to focused, you should send a
NavRequest::FocusOn request.
This Focusable is active
Meaning it is either the focused element or one of the Focusable
on the path to it. All Focusables to the path to the focused
element are active.
This Focusable is dormant
When focus leaves a specific Focusable without being acquired by a
sibling, it becomes dormant. When focus comes back to the
encompassing NavMenu, the focused element will be the dormant
element within the menu.
This Focusable is a cancel focusable, see Focusable::cancel
This Focusable is a locking focusable, see Focusable::lock
This is a “Cancel” focusable
Whenever a NavRequest::Action is sent while this Focusable
is focused, act as if the request was a NavRequest::Cancel
This is a “Lock” focusable
Whenever a NavRequest::Action is sent while this Focusable
is focused, the navigation system stops processing new
NavRequests until it receives NavRequest::Free.
This is useful to implement widgets with complex controls you don’t want to accidentally unfocus, or suspending the navigation system while in-game.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Focusable
impl UnwindSafe for Focusable
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: 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. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub 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. Read more
impl<T> FromWorld for T where
T: Default,
impl<T> FromWorld for T where
T: Default,
pub fn from_world(_world: &mut World) -> T
pub fn from_world(_world: &mut World) -> T
Creates Self using data from the given [World]
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more