Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Logic Writer #1
Help Please :- Common Snapping Distance
Hi all,
I have a lot of sprites on stage which represent magnets. All these sprites
have the same height but different widths. I want to write a program in
which when two sprites come close to each other at a specific distance they
must snap to each other.
Now my main problem is that since each sprite have different widths it is
difficult to fix a single value for the distance within which they should
snap to each other. Also it is also possible that any sprite can come close
to another sprite from any side. So the script should check for the distance
from any side. Please suggest some ways in which I can establish a common
distance between the sprites which have different widths.
Looking forward to suggestions. Thanks a lot.
Regards,
LW J
Logic Writer Guest
-
Snapping
hi I have a problem in my scripting in which i want to snap one model to the other. I have two model's sphere01 n sphere02. To move the model's i... -
tutorial file for snapping
hi can some one plz help me with some tutorial file on snapping 3d objects in 3d world. william -
snap distance > pick distance impossible?
In the General Preferences, I tried to set the value for the pick distance to 1, and the snap distance to 5, but after several tries (and thinking... -
snapping flash components together
I'm piecing together all these flash components and they aren't connecting the only gaps we are trying to fix are: 1. between bottom of black... -
Need help snapping...Please!
Hi guys, a buddy and I have been trying to figure this one out - maybe someone out there has either done this or seen something similar. We're... -
Robert Tweed #2
Re: Help Please :- Common Snapping Distance
"Logic Writer" <logic_writer@rediffmail.com> wrote in message
news:biae2b$6fk$1@forums.macromedia.com...sprites>
> I have a lot of sprites on stage which represent magnets. All thesethey> have the same height but different widths. I want to write a program in
> which when two sprites come close to each other at a specific distanceThe approximate alogorithm in pseudocode:> must snap to each other.
if left edge of sprite > right edge of other sprite then
if:
sprites overlapping
OR right edge of other sprite - left edge of sprite < snap range
then
snap
end if
else <do the same in reverse for other side>
repeat for top & bottom as well as left & right. You can easily get the
edges of the sprites by checking the .rect property instead of just .loc;
you can also use .height, .width and loc together with the regpoint to get
the same values.
- Robert
Robert Tweed Guest



Reply With Quote

