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

Author Topic: [solved] sf::Shape::Line SetPointPosition problem  (Read 1836 times)

0 Members and 1 Guest are viewing this topic.

ThaxSillion

  • Newbie
  • *
  • Posts: 5
    • View Profile
[solved] sf::Shape::Line SetPointPosition problem
« on: November 22, 2009, 01:38:37 pm »
Hello!:) I am quite new to SFML, I've been working with it for a few weeks already, and I must say it is a great library, thank you Laurent.

However, I couldn't find a solution to this problem:
Code: [Select]
sf::Shape Line = sf::Shape::Line(100, 100, 100, 200, 1, sf::Color::White);
Line.SetPointPosition(0, sf::Vector2f(100, 100));
Line.SetPointPosition(1, sf::Vector2f(100, 400));


Setting the points of a line doesn't work as supposed, or maybe I'm just doing it wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[solved] sf::Shape::Line SetPointPosition problem
« Reply #1 on: November 22, 2009, 02:42:35 pm »
A line has a thickness, thus it has 4 points (it is a rectangle). Every sf::Shape is basically a convex polygon, the static sf::Shape functions are just helpers to create the most common shapes. But once it is created, it's nothing more than a polygon with N points.
Laurent Gomila - SFML developer

ThaxSillion

  • Newbie
  • *
  • Posts: 5
    • View Profile
[solved] sf::Shape::Line SetPointPosition problem
« Reply #2 on: November 22, 2009, 02:46:11 pm »
Thanks for claryfying:) The problem is now solved.