[][src]Struct pushrod::widgets::image_widget::ImageWidget

pub struct ImageWidget { /* fields omitted */ }

This is the storage object for the ImageWidget. It stores the config, properties, callback registry, the image name, and a scale flag.

Methods

impl ImageWidget[src]

Creates a new ImageWidget, which draws an image in a supported image format for SDL2 at a specific location on the screen. Requires the name of the image (the full path to the file), the position within the widget (defined as ImagePosition), the xywh bounds, and whether or not the image is scaled within the bounds of the Widget.

pub fn new(image_name: String, points: Points, size: Size, scaled: bool) -> Self[src]

Creates a new instance of the ImageWidget object. Requires an image name (full path of the file), image position (defined in ImagePosition), the xywh bounds of the Widget, and a scale flag. If scaled is set to true, the image will be scaled within the Widget bounds, and the ImagePosition will be ignored. Likewise, if set to false, the image will be displayed for the size of the image, and will be placed in the bounds of the Widget based on the position specified in the ImagePosition.

pub fn get_texture_size(&self) -> Size[src]

Returns the size of the texture.

Trait Implementations

impl Widget for ImageWidget[src]

This is the Widget implementation of the ImageWidget. Image is rendered onto a 3D texture, then copied to the canvas after rendering.

fn on_config_changed(&mut self, _k: u8, _v: Config)[src]

Responds to a screen redraw only if the CONFIG_IMAGE_POSITION key was changed.

fn as_any(&mut self) -> &mut dyn Any[src]

This function is a macro-created getter function that returns the Widget as an Any type. This allows the Widget trait to be downcast into a struct that implements the Widget trait.

fn get_config(&mut self) -> &mut WidgetConfig[src]

This function is a macro-created getter function that returns the Widget's configuration object as a borrowed mutable reference. This code is auto-generated using the default_widget_properties!() macro.

fn get_system_properties(&mut self) -> &mut HashMap<i32, String>[src]

This function is a macro-created getter function that returns the Widget's system properties as a borrowed mutable reference. This code is auto-generated using the default_widget_properties!() macro.

fn get_callbacks(&mut self) -> &mut CallbackRegistry[src]

This function is a macro-created getter function that returns the Widget's CallbackRegistry object as a borrowed mutable reference. This code is auto-generated using the default_widget_properties!() macro.

fn tick_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer]
)
[src]

This function is a macro-created tick callback override, created by the default_widget_callbacks!() macro.

fn mouse_entered_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer]
)
[src]

This function is a macro-created mouse entered callback override, created by the default_widget_callbacks!() macro.

fn mouse_exited_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer]
)
[src]

This function is a macro-created mouse exited callback override, created by the default_widget_callbacks!() macro.

fn mouse_moved_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    _points: Points
)
[src]

This function is a macro-created mouse moved callback override, created by the default_widget_callbacks!() macro.

fn mouse_scrolled_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    _points: Points
)
[src]

This function is a macro-created mouse scrolled callback override, created by the default_widget_callbacks!() macro.

fn button_clicked_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    _button: u8,
    _clicks: u8,
    _state: bool
)
[src]

This function is a macro-created mouse scrolled callback override, created by the default_widget_callbacks!() macro.

Auto Trait Implementations

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.