macroquad_grid/lib.rs
1//! # a grid to use with the macroquad lib
2//!
3//! so if you are:
4//! - making a sudoku game
5//! - chess game
6//! - battleship
7//! - etc.
8//!
9//! you will probably want a grid to work with
10//!
11//! This is a grid to use with macroquad!
12//!
13//! There is a struct called Grid and an enum that you can
14//! use if you want the grid to be somewhere other than the top left corner
15//! (the grids top left corner is the top left corner of the screen unless you
16//! use the enum + setter on grid to move it)
17//!
18//! ## this crate NEEDS to be used with macroquad
19//! its an addon! AN ADDON
20//! you use the grid in your macroquad program
21//!
22//! ## stuff you can do with the grid
23//! in src/grid/main.rs I call every method on the grid
24//! struct so that should be helpful
25//!
26//! Most of them are setters so it should be pretty
27//! straight forward
28//!
29//! ## summary
30//!
31//! you can make a grid and then color the cells, write text to the cells, yeah
32//!
33//! ## cringe
34//!
35//! so a lot of the set_color methods may seems pretty similar
36//! I promise they do not all do the same thing.
37//!
38//! ### elaborate!
39//!
40//! cells have a default bg color and a default selected color
41//! each of these defaults can be overwritten with one of the setters
42//!
43//! you can also explicitly color a cell with a third setter
44//!
45//! the gap between cells can also be colored with a setter
46//!
47//! ## panic
48//!
49//! so when you create a grid it will have a width and a height
50//! (set by you if you use the new method on Grid)
51//! I create a 2D vector with height inner vectors
52//! and each inner vector has width cells
53//! if you try to select, write to, color, etc. a cell
54//! at a row or col that is bigger than the width or
55//! height respectively, then this crate will panic
56//!
57//! ### tldr
58//! don't color/write to/set to a cell that does not exist/is out of bounds
59//!
60mod grid;
61
62pub use grid::Grid;
63pub use grid::Position;
64
65#[cfg(test)]
66mod tests {
67 //use super::*;
68 #[test]
69 fn it_works() {
70 todo!()
71 }
72}