[][src]Struct pushrod::widgets::text_widget::TextWidget

pub struct TextWidget { /* fields omitted */ }

This is the storage object for the TextWidget. It stores the config, properties, callback registry, the font name, style, size, justification, and text message.

Implementations

impl TextWidget[src]

Creates a new TextWidget, which draws a unit of text on the screen, given the specified font, size, justification, and layout coordinates.

pub fn new(
    font_name: String,
    font_style: FontStyle,
    font_size: i32,
    justification: TextJustify,
    msg: String,
    x: i32,
    y: i32,
    w: u32,
    h: u32
) -> Self
[src]

Creates a new TextWidget object. Requires the name of the font (the path to the font file), the style of font (sdl2::ttf::FontStyle), the size in pixels of the font, the TextJustify layout of the font, the message to display, and the x, y, w, h coordinates of the text.

Trait Implementations

impl Widget for TextWidget[src]

This is the Widget implementation of the TextWidget. Text is rendered onto a 3D texture, then copied to the canvas after rendering. It uses blended mode texture mapping, which may be slow (as described by the SDL2 documentation), so this might change later to use 8 bit color mapping.

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

Monitors for changes in the text, color changes, or font sizes.

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])[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])[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])[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],
    _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],
    _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],
    _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.