Skip to content

Instantly share code, notes, and snippets.

@IGBC
Created February 1, 2018 12:28
Show Gist options
  • Save IGBC/9dd26bbe1a652745261c83ce1ddeaaa9 to your computer and use it in GitHub Desktop.
Save IGBC/9dd26bbe1a652745261c83ce1ddeaaa9 to your computer and use it in GitHub Desktop.
fn draw(&self, printer: &Printer) {
// If the background is dirty draw a new background
if self.dirty {
for y in 0..printer.size.y {
printer.with_color(ColorStyle::background(), |printer| {
printer.print_hline((0,y), printer.size.x, " ");
});
}
// set background as clean, so we don't need to do this every frame
self.dirty = false;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment