xy coordinate using slope statements?

Steve Bonham sbonham at georgiasouthern.edu
Mon Jun 20 15:46:21 EDT 2005


Thanks Alex. This is just what I needed.

S


>Steve Bonham wrote:
>
>>
>>All I really need is help with getting Rev to draw a trapezoid at 4 
>>particular screen coordinates. The trouble is HOW to determine the 
>>screen coordinates?
>>
>Here you go - create a stack, with a polygon (graphic with style 
>polygon) called "fairway" (don't worry about what the points of the 
>polygon are - they'll be overwritten anyway).
>
>Then add this as the card handler
>
>on mouseUp
>  -- origin (the tee) is at 300,300
>  -- initial points of the polygon are relative 0,0
>  local thePoints
>  put "300,300 344,332 495,349 538,316 549,300 538,283 495,251 
>344,267 300,300" into thePoints
>
>  put item 1 of mouseloc() into x
>  put item 2 of mouseloc() into y
>
>  -- check for click at the origin
>  if x = 300 and y = 300 then
>    answer "Ha Ha very funny"
>    exit mouseUp
>  end if
>
>  put atan( (y-300) / (x-300) ) into slope
>  if x < 300 then
>    put slope-pi into slope
>  end if
>
>  put empty into newPoints
>  repeat for each word P in thePoints
>    put item 1 of P - 300 into x
>    put item 2 of P - 300 into y
>    put round(300+x*cos(slope) - y*sin(slope)), 
>round(300+x*sin(slope) + y*cos(slope)) & cr after newpoints
>  end repeat
>  set the points of graphic fairway to newpoints
>  end mouseUp
>
>
>--
>Alex Tweedly       http://www.tweedly.net
>
>
>
>--
>No virus found in this outgoing message.
>Checked by AVG Anti-Virus.
>Version: 7.0.323 / Virus Database: 267.7.8/22 - Release Date: 17/06/2005
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your 
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution


-- 


--------------------------------------------------------------------------------------------------
Steve Bonham
Director, Faculty Technology Development Laboratory
Center for Excellence in Teaching - Georgia Southern University
Statesboro, GA 30460-8143
--------------------------------------------------------------------------------------------------


More information about the use-livecode mailing list