SFML community forums
Help => Graphics => Topic started by: Sivak on April 25, 2010, 06:19:51 am
-
Basically, would a circle like the below image be possible to draw out of an SF shape?
(http://img94.imageshack.us/img94/1598/fontydemo.png)
What I want to do is have a sort of "clock" animation where the circle becomes more and more white as it winds down.
Possible? Thanks.[/img]
-
You can do this with compositing shapes or images. Or even just a series of images if you want it to be easy.
If you want it to be transparent you can use alpha blendmode.
You basically put a triangle on top of a circle and widden the base of the triangle. You want the triangle to be longer than the radius of the circle so the circle does not clip the base.
Or you can draw multiple triangles and the size/position depends on time and the last triangle.
-
This is not directly possible with sf::Shape, because sf::Shape can handle only convex shapes. However, you can split the pie into two convex pieces and manually form sf::Shapes by using AddPoint().
-
This is not directly possible with sf::Shape, because sf::Shape can handle only convex shapes
Well, this is not exactly true actually ;)
SFML decomposes the shape into triangles made of an edge and the center point. So it can handle non-convex shapes as long as none of these triangles overlap.
Creating such a shape should be possible with sf::Shape, if you add the center as a point of the shape.
-
Ah, I didn't know that. I have always underestimated sf::Shape... :D
-
Ah, I didn't know that. I have always underestimated sf::Shape... :D
Me too, until I recently realized that the implementation allowed more than convex shapes :D