You need to make a calculation based upon the rect of the vectorShape
sprite.

Here, pntToconvert is a point in the vertex list of a vector shape member,
prctDisplayArea is the rect of the vector shape sprite.  It returns the
equivalent point on the stage.

on vpntPointToStage pntToConvert
  pntToReturn = pntToconvert +
point(prctDisplayArea.left,prctDisplayArea.top)
  return pntToReturn
end

Here is the reverse calculation which converts the point on the stage (ie.
the mouseloc) to a point in the castmember which you can then add to the
vertex list.

on vpntPointToMember pntToConvert
  pntToReturn = pntToconvert -
point(prctDisplayArea.left,prctDisplayArea.top)
  return pntToReturn
end

Note that if you are scaling the vector sprite things get more complex.

Hope this helps,

Steph

> -----Original Message-----
> From: Stevon Ritchie [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 10, 2000 12:47 PM
> To: [EMAIL PROTECTED]
> Subject: <lingo-l> Vectors on the hoof !
> 
> 
> Hi all,
> 
> Are there any vector guru's out there ???
> 
> I've made a handler that makes a vector shape on the fly 
> according to the 
> path of the mouse.
> ie. on mousedown start plotting points on mouseup create 
> vector using the 
> list as its vertexlist.
> 
> All is fine except that i can't work out how to position the 
> vector so that 
> the last vertex point is exactly at the point at which the 
> mouseup occurred. 
> I can put the sprite.loc at that point but how do you work 
> out the (offset) 
> difference between that and the last vertex point ?
> 
> frustrated,
>                                       stevon
> 
> 
> [EMAIL PROTECTED]
> 
> ______________________________________________________________
> ___________
> Get Your Private, Free E-mail from MSN Hotmail at 
http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to