[][src]Trait ytesrev::drawable::Drawable

pub trait Drawable: Send {
    fn content(&self) -> Vec<&dyn Drawable>;
fn content_mut(&mut self) -> Vec<&mut dyn Drawable>;
fn step(&mut self);
fn state(&self) -> State;
fn draw(
        &self,
        _canvas: &mut Canvas<Window>,
        _position: &Position,
        _settings: DrawSettings
    ); fn register(&mut self) { ... }
fn load(&mut self) { ... }
fn event(&mut self, e: Event) { ... }
fn update(&mut self, dt: f64) { ... } }

An object that can be drawn

Required methods

fn content(&self) -> Vec<&dyn Drawable>

What this object contains

fn content_mut(&mut self) -> Vec<&mut dyn Drawable>

What this object contains, mutably

fn step(&mut self)

When the user presses space, the state of the presentation is advanced. This method is what is called.

fn state(&self) -> State

What state the object is in

fn draw(
    &self,
    _canvas: &mut Canvas<Window>,
    _position: &Position,
    _settings: DrawSettings
)

Draw everything

Loading content...

Provided methods

fn register(&mut self)

Register all content. This is mostly just used by LatexObjs, that need to be registered before loaded.

fn load(&mut self)

Load all content

fn event(&mut self, e: Event)

When any event occurs

fn update(&mut self, dt: f64)

Tick the object

Loading content...

Implementors

impl Drawable for Empty[src]

impl Drawable for PngImage[src]

impl Drawable for LatexObj[src]

impl Drawable for Layered[src]

impl Drawable for Solid[src]

impl<'a> Drawable for Stack[src]

impl<T: Drawable + KnownSize> Drawable for Anchor<T>[src]

impl<T: Drawable + KnownSize> Drawable for Margin<T>[src]

impl<T: Drawable> Drawable for WithSize<T>[src]

impl<T: Drawable, U: Drawable> Drawable for Split<T, U>[src]

impl<T: ImageContainer> Drawable for Ditherer<T>[src]

Loading content...