SFML community forums
General => Feature requests => Topic started by: Allptraum on December 09, 2020, 10:20:45 am
-
Sure, you could just use a ConvexShape, but by this logic we wouldn't need RectangleShape either...
Would there be any interest in this feature?
-
Why no hexagon, pentagon, octagon, ...? There has to be a limit ;)
And, as highlighted in the tutorial, regular polygons can be obtained easily with sf::CircleShape:
https://www.sfml-dev.org/tutorials/2.5/graphics-shape.php#built-in-shape-types
Not that triangles can also be constructed with a sf::VertexArray of type "Triangles". This is lower level and will offer better performances.
-
Why no hexagon, pentagon, octagon, ...? There has to be a limit ;)
And, as highlighted in the tutorial, regular polygons can be obtained easily with sf::CircleShape:
https://www.sfml-dev.org/tutorials/2.5/graphics-shape.php#built-in-shape-types
Not that triangles can also be constructed with a sf::VertexArray of type "Triangles". This is lower level and will offer better performances.
For equilateral triangles, yes. But not if you want a triangle to cover three specific points. But this might actually be too much of a nieche shape to have it's own class.
Maybe something for some kind of extension...
-
As Laurent said, for such situations you can directly use a sf::VertexArray :)
-
It's also worth noting that the provided shapes are quite strictly bound by a 2D rectangular area and can only be in one form within it. Triangles can be in many forms within that rectangular area.