6

« **on:** May 17, 2011, 06:48:42 pm »
Ok thank you it seems to be working better with the following:

` `

x1 = x_pos + (bounds_size * .5);

y1 = y_pos + (bounds_size * .5);

x2 = x1 - (Line_Length * cos(M_PI / 4));

y2 = y1 - (Line_Length * sin(M_PI / 4));

Line = sf::Shape::Line ( x1, y1, x2, y2, LINE_THICKNESS, LINE_COLOR, BORDER_WIDTH, BORDER_COLOR );

Line.SetPosition(x1, y1);

Line.SetCenter(x1, y1);

After your last post I tried it using just SetPosition, and it change the point it rotates around to x1,y1, but the radius was still to large. Instead of the line pivoting around one of it's points, the entire line circled around x1,y1 with a large radius of maybe 300 or 400, at times going off the window entirely. After I used SetPosition and SetCenter together, it now pivots around the point.

I've played with different values for SetCenter and SetPosition and I have been unable to discern any pattern in order to figure out the difference, all I know is that if I use them together it sort of works. Could you please give a more detailed explanation?