MCPcopy Create free account
hub / github.com/CleanCut/invaders / draw

Method draw

src/score.rs:19–28  ·  view source on GitHub ↗
(&self, frame: &mut Frame)

Source from the content-addressed store, hash-verified

17
18impl Drawable for Score {
19 fn draw(&self, frame: &mut Frame) {
20 // format our score string
21 let formatted = format!("SCORE: {:0>4}", self.count);
22
23 // iterate over all characters
24 for (i, c) in formatted.chars().enumerate() {
25 // put them in the first row
26 frame[i][0] = c;
27 }
28 }
29}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected