SFML community forums

Help => Graphics => Topic started by: Kippstrahl on December 01, 2009, 08:06:49 pm

Title: Line: SetPointPosition
Post by: Kippstrahl on December 01, 2009, 08:06:49 pm
Hi, i have got a line shape, which goes from

10, 10, to 100, 10

But now i want it to go

20, 20, 200, 20

How do I realise that with SetPointPosition? I really don't know which index is which corner of the rectangle.
Title: Line: SetPointPosition
Post by: Laurent on December 01, 2009, 10:49:46 pm
Just construct a new rectangle:
Code: [Select]
rect = sf::Shape::Rectangle(20, 20, 200, 20, ...);
Title: Line: SetPointPosition
Post by: Kippstrahl on December 02, 2009, 05:27:02 pm
Yes but that only works with horizontal or vertical lines. I need a solution also for Diagonal lines. Should I Just renew the line with the sf::Line(...); function?
Title: Line: SetPointPosition
Post by: Laurent on December 02, 2009, 05:33:25 pm
Sorry, I meant Shape::Line not Shape::Rectangle.