Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Line: SetPointPosition  (Read 1520 times)

0 Members and 1 Guest are viewing this topic.

Kippstrahl

  • Newbie
  • *
  • Posts: 2
    • View Profile
Line: SetPointPosition
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Line: SetPointPosition
« Reply #1 on: December 01, 2009, 10:49:46 pm »
Just construct a new rectangle:
Code: [Select]
rect = sf::Shape::Rectangle(20, 20, 200, 20, ...);
Laurent Gomila - SFML developer

Kippstrahl

  • Newbie
  • *
  • Posts: 2
    • View Profile
Line: SetPointPosition
« Reply #2 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Line: SetPointPosition
« Reply #3 on: December 02, 2009, 05:33:25 pm »
Sorry, I meant Shape::Line not Shape::Rectangle.
Laurent Gomila - SFML developer

 

anything