draw arrow vector from point(x1,y1) to (x2,y2)

Show us your works in progress and request feedback

Post » Sun May 17, 2015 8:38 am

Can anyone help me to draw an arrow from a gIven point to another one; capx file would help...
B
14
S
1
Posts: 66
Reputation: 781

Post » Sun May 17, 2015 11:52 am

I've had a problem like that before, here's my solution :

  • Create a Sprite named "Arrow" and load it with an arrow image (google it or make it yourself in paint or inkscape)
  • Set its origin to "left"
  • Set its position to (x1,y1)
  • Add action "Set angle toward position" and set the parameters to (x2, y2)

That should do the trick. A more advanced solution would be to create two separate sprites for the arrow's head and the arrow's body : "ArrowHead" and "ArrowBody", You would apply the above solution to the arrow's body, then simply place the arrow's head at (x2, y2) and set its angle to "ArrowBody.Angle".
ImageImage
B
44
S
14
G
10
Posts: 167
Reputation: 7,781

Post » Sun May 17, 2015 7:24 pm

thank you!!! gona try this!!!
B
14
S
1
Posts: 66
Reputation: 781

Post » Sat May 23, 2015 3:26 am

You'll also need to set the width to distance(x1,y1,x2,y2)
B
15
S
5
G
7
Posts: 876
Reputation: 5,650


Return to Works in Progress/Feedback Requests

Who is online

Users browsing this forum: Davven7, Yahoo [Bot] and 4 guests