pub struct PrintingPosition {
pub x_printing_position: XPrintingPosition,
pub y_printing_position: YPrintingPosition,
}Expand description
The PrintingPosition is a way to preset a place to print a grid on the screen with the Printer.
By combining an x and y position you can print any grid in 9 positions on the grid.
Say if you wanted to print your grid to the very center of the screen, you’d set that up like so:
use screen_printer::prelude::*;
let printing_position =
PrintingPosition::new(XPrintingPosition::Middle, YPrintingPosition::Middle);
let mut printer = Printer::new_with_printing_position(printing_position);This would make any following use of the dynamic_print method print the grid to the center
of the screen.
For more information about adjusting the PrintingPosition, refer to the examples on github.
For more information about printing, refer to documentation on the Printer and dynamic_print method.
Fields§
§x_printing_position: XPrintingPosition§y_printing_position: YPrintingPositionImplementations§
source§impl PrintingPosition
impl PrintingPosition
sourcepub fn new(
x_printing_position: XPrintingPosition,
y_printing_position: YPrintingPosition
) -> Self
pub fn new( x_printing_position: XPrintingPosition, y_printing_position: YPrintingPosition ) -> Self
Creates a new PrintingPosition with the given X and Y positions.
sourcepub fn with_x_printing_position(x_printing_position: XPrintingPosition) -> Self
pub fn with_x_printing_position(x_printing_position: XPrintingPosition) -> Self
Creates a new PrintingPosition with the given X position, defaulting on the y position.
sourcepub fn with_y_printing_position(y_printing_position: YPrintingPosition) -> Self
pub fn with_y_printing_position(y_printing_position: YPrintingPosition) -> Self
Creates a new PrintingPosition with the given Y position, defaulting on the X position.
Trait Implementations§
source§impl Clone for PrintingPosition
impl Clone for PrintingPosition
source§fn clone(&self) -> PrintingPosition
fn clone(&self) -> PrintingPosition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more