[][src]Trait vga_buffer_rs::Draw

pub trait Draw {
    pub fn get_pos(&self) -> (usize, usize);
pub fn get_size(&self) -> (usize, usize);
pub fn is_transparent(&self) -> bool;
pub fn get_line(&self, l: usize) -> Option<&[u8]>; }

Trait to implement to be passed to a DrawTarget

The drawing MUST be a rectangle.

Required methods

pub fn get_pos(&self) -> (usize, usize)[src]

get tuple (y, x) of the upper left corner of the drawing

pub fn get_size(&self) -> (usize, usize)[src]

get tuple (y, x) of the lower right corner of the drawing

pub fn is_transparent(&self) -> bool[src]

should the ' ' be printed or not

buffer is ['a', 'b', 'v'] and line is [' ', 'i', 'b']

if is_transparent is true, result should be ['a', 'i', 'b'] else it should be [' ', 'i', 'b']

pub fn get_line(&self, l: usize) -> Option<&[u8]>[src]

get a single line of the drawing

return None if 'l' is out of range

Loading content...

Implementors

impl Draw for BoxShape[src]

Loading content...