scrolling stack I made
Geoff Canyon
gcanyon at gmail.com
Wed May 22 13:02:54 EDT 2013
Funny, I thought I was getting away with it because I was scrolling to the
left, where the use of trunc instead of round meant that even at the
slowest setting, everything was moving, in some cases too fast.
Here it is adapted to use the array again. It's too bad (for this) that the
loc can't use a fractional value and just work.
on addimage imagename, imageplace, imagespeed
put imagename into places[imagename]["imagename"]
put imageplace into places[imagename]["imageplace"]
put imagespeed into places[imagename]["imagespeed"]
end addimage
on movethings howmuch
lock screen
repeat for each key K in places
put (3072 + places[K]["imageplace"] +
howmuch*100/places[K]["imagespeed"]) mod 2048 - 1024 into
places[K]["imageplace"]
set the left of image places[K]["imagename"] to
trunc(places[K]["imageplace"])
end repeat
unlock screen
end movethings
On Wed, May 22, 2013 at 10:00 AM, Colin Holgate <coiin at verizon.net> wrote:
> The use of an array value was intentional. Try your version and my version
> while moving very slowly, you'll see that lots of the images will stall in
> your one. That's because the value keeps rounding down to the nearest
> pixel. The array approach makes the location be floating point, and so over
> time the image will reach the next integer value.
>
>
> On May 22, 2013, at 10:28 AM, Geoff Canyon <gcanyon at gmail.com> wrote:
>
> > I also simplified the movement routine to a single line to update the
> > position of each object, which eliminated the need to store the position
> in
> > the array.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list