Created
February 1, 2018 12:28
-
-
Save IGBC/9dd26bbe1a652745261c83ce1ddeaaa9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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