Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Line: SetPointPosition
Print
Pages: [
1
]
Author
Topic: Line: SetPointPosition (Read 1861 times)
0 Members and 2 Guests are viewing this topic.
Kippstrahl
Newbie
Posts: 2
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.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
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, ...);
Logged
Laurent Gomila - SFML developer
Kippstrahl
Newbie
Posts: 2
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?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Line: SetPointPosition
«
Reply #3 on:
December 02, 2009, 05:33:25 pm »
Sorry, I meant Shape::Line not Shape::Rectangle.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Line: SetPointPosition