Hello
i guess this is kind of a basic question, but i'm really a newbie. How do I attach an arrow to one or both the endings of a line? I guess I need to draw a triangle, but do I need to calculate by hand the coordinates, or is there
around some predefined function that I can add, by specifying the width of the arrow and how log it's supposed to be?
thanks,
valerio
line with arrows?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: line with arrows?
Nope, but I can give you a hint on what you need to do:vschiavoni wrote:or is there
around some predefined function that I can add, by specifying the width of the arrow and how log it's supposed to be?
math.atan2(y, x), math.cos(a) and math.sin(a).
Help us help you: attach a .love.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: line with arrows?
I decided to write four arrow implementations, just for the heck of it. Four variants are (open, close) x (one end, two end). I'm sure you can make them much more advanced, for example by using setLineWidth or setLineStyle between draws, but this is the basic idea.
- Attachments
-
- arrow.love
- (667 Bytes) Downloaded 322 times
Help us help you: attach a .love.
Who is online
Users browsing this forum: No registered users and 4 guests