[][src]Struct graphics::grid::Grid

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]

pub fn draw<G>(
    &self,
    line: &Line,
    draw_state: &DrawState,
    transform: Matrix2d,
    g: &mut G
) where
    G: Graphics
[src]

Draws the grid.

Important traits for GridCells
pub fn cells(&self) -> GridCells
[src]

Get a GridIterator for the grid

pub fn cell_position(&self, cell: (u32, u32)) -> Vec2d
[src]

Get on-screen position of a grid cell

pub fn x_pos(&self, cell: (u32, u32)) -> Scalar
[src]

Get on-screen x position of a grid cell

pub fn y_pos(&self, cell: (u32, u32)) -> Scalar
[src]

Get on-screen y position of a grid cell

Trait Implementations

impl Copy for Grid
[src]

impl Clone for Grid
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Grid
[src]

Auto Trait Implementations

impl Send for Grid

impl Sync for Grid

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]