SFML community forums

General => Feature requests => Topic started by: nitram_cero on May 07, 2009, 08:35:26 pm

Title: sf::Shape::Rectangle that takes a FloatRect
Post by: nitram_cero on May 07, 2009, 08:35:26 pm
It's really simple, but I find myself an awfull lot of times calling:
sf::Shape::Rectangle(r.Left, r.Top, r.Right, r.Bottom, ...)

Thanks
-Martín
Title: sf::Shape::Rectangle that takes a FloatRect
Post by: Laurent on May 08, 2009, 12:01:51 pm
Then just write this function ;)
Code: [Select]
sf::Shape Rectangle(const sf::FloatRect& rect, ...)
{
    return sf::Shape::Rectangle(rect.Left, rect.Top, rect.Right, rect.Bottom, ...);
}
Title: sf::Shape::Rectangle that takes a FloatRect
Post by: nitram_cero on May 08, 2009, 04:45:49 pm
I thought that as it took 4 coordinates or two vectors it could also take 1 rect.

I know I can create a function to do that, as I can do it adding points to a sf::Shape from scratch.
But that's not the point.

-Martín