[Xerte] drawArrow()

Tenney Julian Julian.Tenney at nottingham.ac.uk
Mon Sep 3 10:03:44 BST 2007


Hi,
 
drawArrow was added to support the drawing tools. It always draws arrows
at 0,0. You can of course set the _x and _y of the clip / icon you are
drawing into to position the arrow, and to rotate it you can set the
_rotation property of the movieclip. 
 
You might want to look at arrowTo(x1,y1,x2,y2,[size], [spread]) which
conveniently connects two points with an arrow. Size and spread are
optional, but control the appearance of the arrowhead. Size is the
length of the arrow head from its tip to its base, spread is an angle in
radians that defines how sharp the arrow is. If you want to do this
calculation in degrees it would be:
 
ar.arrowTo(100,100,300,100, 20, 45 * Math.PI / 180); //creates an arrow
with a 90 degree point, as spread applies on each side.
 
Play around with the values to see what you like best,
 
Julian


________________________________

	From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Swanson
	Sent: 31 August 2007 19:36
	To: Xerte discussion list
	Subject: [Xerte] drawArrow()
	
	

	Sorry to post so many questions lately. Can anyone enlighten me
on the following? 

	I found that I can draw an arrow with code, but I can't find a
list of the arguments the method takes. If I use the following to create
an arrow:

	arrow2.lineStyle(2,0xFF0000,100); 
	arrow2.drawArrow(100,100,300,10); 

	I get a red arrow that is 300 pixels long and 10 high, but it
seems to start at x=0 y=0, no matter what I use for the first two
arguments, even if I use empty strings in place of integers. And I
imagine there is an angle argument. Is there any documentation anywhere
that lists what these arguments are? I've been Googling all morning and
haven't found anything.

	I know I can use moveTo() and rotateTo() to position the arrow,
but it would be nice to know what arguments the method takes, or where
to look for this information.

	Thanks! 

	_____________________________ 

	 Paul Swanson 
	 Instructional Designer 
	 Harland Financial Solutions 
	_____________________________ 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20070903/3efad50c/attachment.html


More information about the Xerte mailing list