set2DProjection method
Configures an orthographic 2D projection matrix.
This is commonly used for 2D games. The projection maps world coordinates directly to screen coordinates.
x: The left edge of the view. Defaults to 0.0.y: The top edge of the view. Defaults to 0.0.width: The width of the view.height: The height of the view.
After calculating the matrix, it calls setProjectionMatrix.
Implementation
void set2DProjection({double x = 0.0, double y = 0.0, required double width, required double height}) {
setProjectionMatrix(makeOrthographicMatrix(x, x + width, y + height, y, -1, 1));
}