[−][src]Struct mief::elements::scoreboard::Scoreboard
The scoreboard displays information on the game, such as the current score and the name.
Fields
title: StringThe name of the game.
height: u32The height of the scoreboard.
width: u32The width of the scoreboard.
scores: [isize; 2]The players' scores.
Methods
impl Scoreboard[src]
pub fn new(size: [u32; 2], title: &str) -> Scoreboard[src]
Initialize a new scoreboard with a given size ([width, height]) and a title.
fn determine_font_size(&self) -> u32[src]
Determine the font size based on the height of the scoreboard.
fn draw_text(
&self,
text: &str,
alignment: &TextAlignment,
position_x: f64,
font: &mut Glyphs,
context: &Context,
graphics: &mut G2d
)[src]
&self,
text: &str,
alignment: &TextAlignment,
position_x: f64,
font: &mut Glyphs,
context: &Context,
graphics: &mut G2d
)
Draw the given text aligned at position_x on the screen. The text is always vertically aligned at the middle
of the scoreboard.
pub fn on_render(&self, font: &mut Glyphs, context: Context, graphics: &mut G2d)[src]
Render the scoreboard.
pub fn on_resize(&mut self, new_width: u32, new_height: u32)[src]
Resize the scoreboard.
pub fn on_update(&mut self, scores: [isize; 2])[src]
Update the scoreboard.