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

Author Topic: Line shape  (Read 2567 times)

0 Members and 1 Guest are viewing this topic.

Ockonal

  • Jr. Member
  • **
  • Posts: 58
    • ICQ Messenger - 449909010
    • View Profile
    • WinCode
Line shape
« on: January 30, 2012, 10:11:54 pm »
Hello, after new upgrade in sfml api I founded that sf::Shape::Line, for example was removed. So now the only way to do is to create polygon with 2 points?
Developing 2d engine&game using: sfml, box2d, librocket, spark2, zoom&zoost, thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Line shape
« Reply #1 on: January 30, 2012, 10:15:19 pm »
It was already discussed, in both the task tracker and the forum. Use the "search" button ;)
Laurent Gomila - SFML developer

Ockonal

  • Jr. Member
  • **
  • Posts: 58
    • ICQ Messenger - 449909010
    • View Profile
    • WinCode
Line shape
« Reply #2 on: January 30, 2012, 10:41:54 pm »
Okay, sorry. I've tried to search it at forum but failed :) At bug tracker there is an answer, thanks.
Developing 2d engine&game using: sfml, box2d, librocket, spark2, zoom&zoost, thor

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Line shape
« Reply #3 on: January 30, 2012, 11:22:13 pm »
After searching a few minutes (it was harder to find than I thought) I found it here: http://www.sfml-dev.org/forum/viewtopic.php?p=42814&highlight=rectangleshape#42814

Quote
Quick question: now that sf::Shape::Line is gone, how can I easily draw a line from point A to point B ?

Quote
If your line has a thickness, it's a rectangle and you can use sf::RectangleShape.

If it has no thickness, you can draw two vertices in sf::Lines mode.
TGUI: C++ SFML GUI