Surface

Trait Surface 

Source
pub trait Surface {
    // Required methods
    fn clear(&mut self);
    fn pixel(&mut self, x: i32, y: i32);
    fn width(&self) -> i32;
    fn height(&self) -> i32;

    // Provided method
    fn line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32) { ... }
}
Expand description

A drawable surface

Required Methods§

Source

fn clear(&mut self)

Clear all pixels

Source

fn pixel(&mut self, x: i32, y: i32)

Fill a pixel

Source

fn width(&self) -> i32

Get the width of the surface

Source

fn height(&self) -> i32

Get the height of the surface

Provided Methods§

Source

fn line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32)

Draw a line

Implementors§