[][src]Struct rg3d_ui::UserInterface

pub struct UserInterface<M: 'static, C: 'static + Control<M, C>> { /* fields omitted */ }

Implementations

impl<M: 'static, C: 'static + Control<M, C>> UserInterface<M, C>[src]

pub fn new(screen_size: Vec2) -> UserInterface<M, C>[src]

pub fn keyboard_modifiers(&self) -> KeyboardModifiers[src]

pub fn build_ctx(&mut self) -> BuildContext<M, C>[src]

pub fn capture_mouse(&mut self, node: Handle<UINode<M, C>>) -> bool[src]

pub fn release_mouse_capture(&mut self)[src]

pub fn get_drawing_context(&self) -> &DrawingContext[src]

pub fn get_drawing_context_mut(&mut self) -> &mut DrawingContext[src]

pub fn screen_size(&self) -> Vec2[src]

pub fn update(&mut self, screen_size: Vec2, dt: f32)[src]

pub fn draw(&mut self) -> &DrawingContext[src]

pub fn cursor_position(&self) -> Vec2[src]

pub fn hit_test(&self, pt: Vec2) -> Handle<UINode<M, C>>[src]

pub fn find_by_criteria_down<Func>(
    &self,
    node_handle: Handle<UINode<M, C>>,
    func: &Func
) -> Handle<UINode<M, C>> where
    Func: Fn(&UINode<M, C>) -> bool
[src]

Searches a node down on tree starting from give root that matches a criteria defined by a given func.

pub fn find_by_criteria_up<Func>(
    &self,
    node_handle: Handle<UINode<M, C>>,
    func: Func
) -> Handle<UINode<M, C>> where
    Func: Fn(&UINode<M, C>) -> bool
[src]

Searches a node up on tree starting from given root that matches a criteria defined by a given func.

pub fn is_node_child_of(
    &self,
    node_handle: Handle<UINode<M, C>>,
    root_handle: Handle<UINode<M, C>>
) -> bool
[src]

Checks if specified node is a child of some other node on root_handle. This method is useful to understand if some event came from some node down by tree.

pub fn is_node_direct_child_of(
    &self,
    node_handle: Handle<UINode<M, C>>,
    root_handle: Handle<UINode<M, C>>
) -> bool
[src]

Checks if specified node is a direct child of some other node on root_handle.

pub fn find_by_name_up(
    &self,
    node_handle: Handle<UINode<M, C>>,
    name: &str
) -> Handle<UINode<M, C>>
[src]

Searches a node by name up on tree starting from given root node.

pub fn find_by_name_down(
    &self,
    node_handle: Handle<UINode<M, C>>,
    name: &str
) -> Handle<UINode<M, C>>
[src]

Searches a node by name down on tree starting from given root node.

pub fn borrow_by_name_up(
    &self,
    start_node_handle: Handle<UINode<M, C>>,
    name: &str
) -> &UINode<M, C>
[src]

Searches a node by name up on tree starting from given root node and tries to borrow it if exists.

pub fn borrow_by_name_up_mut(
    &mut self,
    start_node_handle: Handle<UINode<M, C>>,
    name: &str
) -> &mut UINode<M, C>
[src]

Searches a node by name up on tree starting from given root node and tries to borrow it as mutable if exists.

pub fn borrow_by_name_down(
    &self,
    start_node_handle: Handle<UINode<M, C>>,
    name: &str
) -> &UINode<M, C>
[src]

Searches a node by name down on tree starting from given root node and tries to borrow it if exists.

pub fn borrow_by_name_down_mut(
    &mut self,
    start_node_handle: Handle<UINode<M, C>>,
    name: &str
) -> &mut UINode<M, C>
[src]

Searches a node by name down on tree starting from given root node and tries to borrow it as mutable if exists.

pub fn borrow_by_criteria_up<Func>(
    &self,
    start_node_handle: Handle<UINode<M, C>>,
    func: Func
) -> &UINode<M, C> where
    Func: Fn(&UINode<M, C>) -> bool
[src]

Searches for a node up on tree that satisfies some criteria and then borrows shared reference.

Panics

It will panic if there no node that satisfies given criteria.

pub fn try_borrow_by_criteria_up<Func>(
    &self,
    start_node_handle: Handle<UINode<M, C>>,
    func: Func
) -> Option<&UINode<M, C>> where
    Func: Fn(&UINode<M, C>) -> bool
[src]

pub fn borrow_by_criteria_up_mut<Func>(
    &mut self,
    start_node_handle: Handle<UINode<M, C>>,
    func: Func
) -> &mut UINode<M, C> where
    Func: Fn(&UINode<M, C>) -> bool
[src]

Searches for a node up on tree that satisfies some criteria and then borrows mutable reference.

Panics

It will panic if there no node that satisfies given criteria.

pub fn sender(&self) -> Sender<UiMessage<M, C>>[src]

Returns instance of message sender which can be used to push messages into queue from other threads.

pub fn send_message(&self, message: UiMessage<M, C>)[src]

pub fn poll_message(&mut self) -> Option<UiMessage<M, C>>[src]

Extracts UI event one-by-one from common queue. Each extracted event will go to all available nodes first and only then will be moved outside of this method. This is one of most important methods which must be called each frame of your game loop, otherwise UI will not respond to any kind of events and simply speaking will just not work.

pub fn captured_node(&self) -> Handle<UINode<M, C>>[src]

pub fn process_os_event(&mut self, event: &OsEvent) -> bool[src]

Translates raw window event into some specific UI message. This is one of the most important methods of UI. You must call it each time you received a message from a window.

pub fn nodes(&self) -> &Pool<UINode<M, C>>[src]

pub fn root(&self) -> Handle<UINode<M, C>>[src]

pub fn add_node(&mut self, node: UINode<M, C>) -> Handle<UINode<M, C>>[src]

pub fn push_picking_restriction(&mut self, node: Handle<UINode<M, C>>)[src]

pub fn remove_picking_restriction(&mut self, node: Handle<UINode<M, C>>)[src]

pub fn picking_restriction_stack(&self) -> &[Handle<UINode<M, C>>][src]

pub fn drop_picking_restrictions(&mut self)[src]

Removes all picking restrictions.

pub fn top_picking_restriction(&self) -> Handle<UINode<M, C>>[src]

Links specified child with specified parent.

Unlinks specified node from its parent and attaches back to root canvas.

pub fn node(&self, node_handle: Handle<UINode<M, C>>) -> &UINode<M, C>[src]

pub fn copy_node(&mut self, node: Handle<UINode<M, C>>) -> Handle<UINode<M, C>>[src]

Auto Trait Implementations

impl<M, C> !RefUnwindSafe for UserInterface<M, C>

impl<M, C> !Send for UserInterface<M, C>

impl<M, C> !Sync for UserInterface<M, C>

impl<M, C> Unpin for UserInterface<M, C> where
    C: Unpin,
    M: Unpin

impl<M, C> !UnwindSafe for UserInterface<M, C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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