SFML community forums
Help => Graphics => Topic started by: thewavelength on May 22, 2012, 06:25:06 pm
-
Hello,
why there is no simple polygon / shape object available in 2.0? (Like it was in 1.6)
Is there an alternative? :-)
Thanks!
-
sf:Shape (http://www.sfml-dev.org/documentation/2.0/classsf_1_1Shape.php) ?
Yes, it changed since 1.6, but for the best :D
-
Yes,
but I don't see how I can add some points to the shape?
Let's say, I want to create a hexagon. How I should gonna do that?
Thanks :->
-
You have different ways :
If you need a pre-defined shape (rectangle, circle) you can find tose classes that inherits from sf::Shape
If you need another convex shape, use sf::ConvexShape (http://www.sfml-dev.org/documentation/2.0/classsf_1_1ConvexShape.php). This class is full documented if you wanna know how to add points, set colors, etc...
Edit: If you want a concave shape, you can look at Thor (http://www.bromeon.ch/libraries/thor/index.html) implementation.
-
Well, thanks.
Sorry, next time I look into the documentation more detailed. Last time I've used 2.0 is a bit ago, and if I remember correctly, there was no ConvexShape :X
Thanks :->
-
Well, thanks.
Sorry, next time I look into the documentation more detailed. Last time I've used 2.0 is a bit ago, and if I remember correctly, there was no ConvexShape :X
Thanks :->
Yeah, I understand that this change can be a bit confusing ;D
-
Am I right that Thor 1.1 is incompatible with the 2.0 release?
If I'm incorrect, can you give me an example of how to create a concave shape?
I don't understand why thor::ConcaveShape is an abstract class...
Thanks!
-
Am I right that Thor 1.1 is incompatible with the 2.0 release?
If I'm incorrect, can you give me an example of how to create a concave shape?
I don't understand why thor::ConcaveShape is an abstract class...
Thanks!
There is a version 2 in development, I don't know if it is fully stable since it is in development, but if I'm not mistaken it's compatible with 2.0
I can't say for sure how to implement such a class, but it might be a file somewhere in the 2.0 snapshot that contain the implementation of ConcaveShape (a .cpp or .inl) [Nexus will slap me if I'm wrong :p]
-
The Thor development version should be compatible with SFML 2.0 RC (or the Git version, if I remember correctly there are no API changes).
thor::ConcaveShape is not abstract. There is the documentation (the class interface is quite similar to sf::ConvexShape) on my website (www.bromeon.ch/libraries/thor) and an example in the SDK, which is downloadable via GitHub.