How to draw a line between objects or letters?
DunbarX at aol.com
DunbarX at aol.com
Fri Jun 5 15:56:25 EDT 2009
William;
on mouseUp
lock screen
if there is a graphic "tLine" then delete graphic "tLine"
ask "Find which chars?"
put it into tChar
find chars tChar in fld yourField1
put the foundLoc & return after tLocs
find chars tChar in fld yourField2
put the foundLoc after tLocs
create grc
set the name of the last graphic to "tLine"
set style of graphic tLine to "line"
set points of graphic tLine to line 1 of tLocs & return & line 2 of
tLocs
select after text of fld yourField2 --deselect the found box, should
be a better way
click at "0,0"
end mouseUp
You will notice that the line is drawn from the topleft of the character.
Depending on how you want it to look, and the textSize and other properties,
you might move it to the center of the char. I think, though, you should
create two small rectangle graphics and frame the chars with the line
connecting them.
Never used an image, but they are objects and should have a loc. You have
to access them by name, number or id, though, and that is something set at
the time they are created (text is more accessable, just by its nature).
Should not be very different, though, from the simple method above,
Craig Newman
**************
We found the real ‘Hotel California’ and the ‘
Seinfeld’ diner. What will you find? Explore WhereItsAt.com.
(http://www.whereitsat.com/#/music/all-spots/355/47.796964/-66.374711/2/Youve-Found-Where-Its-
At?ncid=emlcntnew00000007)
More information about the use-livecode
mailing list