[][src]Trait pushrod::widget::widget::Drawable

pub trait Drawable {
    fn draw(&mut self, _c: Context, _g: &mut GlGraphics, _clip: &DrawState) { ... }
fn draw_with_offset(
        &mut self,
        c: Context,
        g: &mut GlGraphics,
        clip: &DrawState,
        point_offset: Point
    ) { ... } }

Provided methods

fn draw(&mut self, _c: Context, _g: &mut GlGraphics, _clip: &DrawState)

Draws the Widget's contents. Only gets called if the Widget is in invalidated state. Provides a modified Context object that has an origin of 0x0 in drawing space for the draw routine. Also provides a mut G2d object against which to draw, and a clip, which is automatically set to provide a clipping area for the Widget. If the Widget draws outside of the clipped bounds, that will not be drawn on the screen.

fn draw_with_offset(
    &mut self,
    c: Context,
    g: &mut GlGraphics,
    clip: &DrawState,
    point_offset: Point
)

Draws an object at an offset on the screen. This is a convenience method that is used by other Widgets that contain multiple widgets. Draw with offset always uses 0x0 as the starting drawing coordinates, as this is what will be drawn within the bounds of the Widget. (See CheckboxWidget and ImageButtonWidget for good examples of this use.)

Loading content...

Implementors

impl Drawable for BoxWidget[src]

impl Drawable for CheckboxWidget[src]

impl Drawable for ImageButtonWidget[src]

impl Drawable for ImageWidget[src]

impl Drawable for ProgressWidget[src]

impl Drawable for PushButtonWidget[src]

impl Drawable for RadioButtonWidget[src]

impl Drawable for TextWidget[src]

impl Drawable for TimerWidget[src]

impl Drawable for ToggleButtonWidget[src]

impl Drawable for CanvasWidget[src]

Loading content...