Title: Re: How to use bounding boxes and points?
Post by: AlexAUT on May 02, 2015, 12:11:52 am
getGlobalBounds does not return a sf::RectangleShape, instead it returns a sf::Rect<float> (FloatRect).
A quick look at the documentation would have solved your problem: sf::Sprite::getGlobalBounds() (http://www.sfml-dev.org/documentation/2.2/classsf_1_1Sprite.php#a203d2d8087bfdca2ebc3c0485cdb7409)
The rest of your code looks ok if you change sf::RectangleShape with sf::FloatRect
AlexAUT
Title: Re: How to use bounding boxes and points?
Post by: Laurent on May 02, 2015, 10:20:12 am
Quote
YeS I have read the forums and looked on the wiki.
The primary source of documentation should be the API doc and the tutorials ;) Forum and wiki content is a lot more random.