SFML community forums

Help => General => Topic started by: NGM88 on June 06, 2017, 09:56:04 pm

Title: 1.6 to 2.x help with shapes
Post by: NGM88 on June 06, 2017, 09:56:04 pm
How would these be converted to 2.x?

win.draw(sf::Shape::Rectangle(le.Blocks[0].fRect, sf::Color(255, 0, 0)));
rt.draw(sf::Shape(sf::Shape::Line(l.position, end, 1, l.color)));

le.Blocks is basically a vector of FloatRects.
l.position and end are Vector2fs
Title: Re: 1.6 to 2.x help with shapes
Post by: Hapax on June 06, 2017, 10:01:09 pm
Looks like you need sf::RectangleShape (https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1RectangleShape.php).
Title: Re: 1.6 to 2.x help with shapes
Post by: NGM88 on June 19, 2017, 12:13:26 am
Well, I failed :/

if anyone wants to take a look:

https://stackoverflow.com/questions/44620031/dynamic-lighting-program-with-sfml-1-6-to-2-x-conversion