SFML community forums
Help => Graphics => Topic started by: Sklfl on August 17, 2022, 01:47:41 pm
-
Hi guys!
I would like to create a matrix having a size for example [10][10] and consist of the drawn squares. How to make and output it on the screen not only a line, but also a matrix?
P. S. I know English poorly. Sorry)
-
Depends on what the matrix contains/represents.
Is it some numbers or some tiles or something else?
-
There will be objects of the CircleShape class
-
I personally suggest to represent the matrix in a 1D space by calculating the necessary offset, if you don't want to do that, you can use std::vector<std::vector<sf::CircleShape>>> and then initialize it correctly.
For drawing it to the window, you'll just need to loop over both dimensions and call window.draw()