SFML community forums

Help => Graphics => Topic started by: Zee on April 08, 2012, 01:04:00 am

Title: Trouble understanding SFML 2 RectangleShape
Post by: Zee on April 08, 2012, 01:04:00 am
Hi, I recently switched to sfml 2 and I've been having trouble understanding the rectangle shape. Did a lot of forum searches but not much came up.

Anyways, I'm trying to draw rectangles in an efficient way, one liner, setting the position and color. Originally, this is my code for sfml 1.6 was


App.Draw(sf::Shape::Rectangle(45, 45, 500, 160, sf::Color::Color(0,0,0,100)));


I was just wondering if that's still possible somehow in SFML 2.

Thanks!

EDIT: forgot to mention, yeah I've looked at the documentation and everything. The vector construction part was very confusing and I'm kind of a beginner.
Title: Re: Trouble understanding SFML 2 RectangleShape
Post by: Zee on April 08, 2012, 03:54:45 am
Update: I ended up building a workaround for this, just went ahead and wrote a function that took the necessary variables and built the rectangle that way.