Trait IsFocused

Source
pub trait IsFocused {
    // Required methods
    fn is_focused(&self, entity: Entity) -> bool;
    fn is_focus_within(&self, entity: Entity) -> bool;
    fn is_focus_visible(&self, entity: Entity) -> bool;
    fn is_focus_within_visible(&self, entity: Entity) -> bool;
}
Expand description

Trait which defines methods to check if an entity currently has focus.

This is implemented for World and IsFocusedHelper. DeferredWorld indirectly implements it through Deref.

For use within systems, use IsFocusedHelper.

Modify the InputFocus resource to change the focused entity.

Required Methods§

Source

fn is_focused(&self, entity: Entity) -> bool

Returns true if the given entity has input focus.

Source

fn is_focus_within(&self, entity: Entity) -> bool

Returns true if the given entity or any of its descendants has input focus.

Note that for unusual layouts, the focus may not be within the entity’s visual bounds.

Source

fn is_focus_visible(&self, entity: Entity) -> bool

Returns true if the given entity has input focus and the focus indicator should be visible.

Source

fn is_focus_within_visible(&self, entity: Entity) -> bool

Returns true if the given entity, or any descendant, has input focus and the focus indicator should be visible.

Implementations on Foreign Types§

Source§

impl IsFocused for World

Source§

fn is_focused(&self, entity: Entity) -> bool

Source§

fn is_focus_within(&self, entity: Entity) -> bool

Source§

fn is_focus_visible(&self, entity: Entity) -> bool

Source§

fn is_focus_within_visible(&self, entity: Entity) -> bool

Implementors§