Struct piston_window::grid::Grid
source · [−]Expand description
Represents a flat grid with square cells.
Fields
cols: u32
Number of columns.
rows: u32
Number of rows.
units: f64
The width and height of each grid cell.
Implementations
sourceimpl Grid
impl Grid
sourcepub fn draw<G>(
&self,
line: &Line,
draw_state: &DrawState,
transform: [[f64; 3]; 2],
g: &mut G
) where
G: Graphics,
pub fn draw<G>(
&self,
line: &Line,
draw_state: &DrawState,
transform: [[f64; 3]; 2],
g: &mut G
) where
G: Graphics,
Draws the grid.
sourcepub fn cells(&self) -> GridCellsⓘNotable traits for GridCellsimpl Iterator for GridCells type Item = (u32, u32);
pub fn cells(&self) -> GridCellsⓘNotable traits for GridCellsimpl Iterator for GridCells type Item = (u32, u32);
Get a GridIterator for the grid
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnwindSafe for Grid
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more