[][src]Trait mergui::widgets::Widget

pub trait Widget {
    fn contains(&self, pos: &Vector2<f32>) -> bool;
fn is_focusable(&self, pos: &Vector2<f32>) -> bool;
fn render(&mut self, gfx: &mut Graphics, window: &Window) -> Result<()>; fn get_cursor_on_hover(&self, _: &Vector2<f32>) -> CursorIcon { ... }
fn set_focus(&mut self, _: &Vector2<f32>, _: bool) { ... }
fn set_hover(&mut self, _: &Vector2<f32>, _: bool) { ... }
fn on_click(&mut self, _location: &Vector2<f32>) { ... }
fn on_key_press(&mut self, _key: Key, _state: bool) { ... }
fn on_typed(&mut self, _char: char) { ... } }

This is the real widget. It isn't meant to interact directly with except when creating other widgets that exist of multiple smaller ones

Required methods

fn contains(&self, pos: &Vector2<f32>) -> bool

fn is_focusable(&self, pos: &Vector2<f32>) -> bool

fn render(&mut self, gfx: &mut Graphics, window: &Window) -> Result<()>

Loading content...

Provided methods

fn get_cursor_on_hover(&self, _: &Vector2<f32>) -> CursorIcon

fn set_focus(&mut self, _: &Vector2<f32>, _: bool)

fn set_hover(&mut self, _: &Vector2<f32>, _: bool)

fn on_click(&mut self, _location: &Vector2<f32>)

fn on_key_press(&mut self, _key: Key, _state: bool)

fn on_typed(&mut self, _char: char)

Loading content...

Implementors

impl Widget for ImageButton[src]

impl Widget for Image[src]

impl Widget for Text[src]

impl Widget for TextButton[src]

impl Widget for Button[src]

impl Widget for Input[src]

impl<T: Clone> Widget for DropDown<T>[src]

impl<W: Widget> Widget for Concealer<W>[src]

impl<W: Widget> Widget for ConcealerManager<W>[src]

Loading content...