Trait pixel_game_lib::gui::Widget

source ·
pub trait Widget {
    // Required methods
    fn update_layout(&mut self, location: Vec2<f64>, size: Extent2<f64>);
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;
}
Expand description

Allow calling function on widgets in a simple way.

Required Methods§

source

fn update_layout(&mut self, location: Vec2<f64>, size: Extent2<f64>)

Update the widget layout position, defines how it must be drawn.

source

fn as_any(&self) -> &dyn Any

Convert to Any so we can convert it back to the original type.

source

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

Convert to mutable Any so we can convert it back to the original type.

Implementors§