Struct graphics::grid::Grid
[−]
[src]
pub struct Grid { pub cols: u32, pub rows: u32, pub units: Scalar, }
Represents a flat grid with square cells.
Fields
cols: u32
Number of columns.
rows: u32
Number of rows.
units: Scalar
The width and height of each grid cell.
Methods
impl Grid
[src]
fn draw<G>(&self, line: &Line, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics
Draws the grid.
fn cells(&self) -> GridCells
Get a GridIterator for the grid
fn cell_position(&self, cell: (u32, u32)) -> Vec2d
Get on-screen position of a grid cell
fn x_pos(&self, cell: (u32, u32)) -> Scalar
Get on-screen x position of a grid cell
fn y_pos(&self, cell: (u32, u32)) -> Scalar
Get on-screen y position of a grid cell
Trait Implementations
impl Clone for Grid
[src]
fn clone(&self) -> Grid
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more