bookCollapseSection | weight | draft |
---|---|---|
true |
2 |
false |
The p5.js functions provide tools to seamlessly create, draw, and iterate over quadrille cells. Whether you're building board games, designing generative visuals, or managing cell-based data, these functions serve as a bridge between the p5.js canvas and the quadrille object—the core structure of the p5.quadrille.js library.
-
[createQuadrille(args)]({{< ref "create_quadrille" >}}): Creates a quadrille with flexible initialization options. You can populate it with an valid JavaScript value, including colors, numbers, strings, images & videos, p5.Graphics, (drawing) functions, or custom objects.
-
[drawQuadrille(args)]({{< ref "draw_quadrille" >}}): Renders the quadrille onto the p5.js canvas with options for visual customization. Styles are applied globally to all quadrille cells, allowing you to display content, apply color, and enhance visuals—well-suited to displaying board game states, dynamic patterns, or data visualizations.
-
[visitQuadrille(args)]({{< ref "visit_quadrille" >}}): Iterates through the quadrille's cells, allowing you to access, modify, or analyze their content. Use this function to implement game mechanics, apply transformations, or programmatically update the state of quadrille cells.
Alongside the p5.js API, these functions allow you to start developing immersive board games, organizing data collections, creating dynamic visual art, and building creative projects based on structured, cell-based content.