Smoothly moving a jpeg

Scott Rossi scott at tactilemedia.com
Wed Dec 16 20:24:56 EST 2009


Recently, Tim Selander wrote:

> The next thing I'm trying to do is take a jpeg of vertical, right
> to left Japanese text and move it smoothly across the window at
> reading speed for a teleprompter app. I'm using the "move image"
> command. The result is a little to jerky and stuttery.
> 
> Does Rev have a smoother way to animate/move images on the screen?

If the image spans the entire width and/or height of the screen, you may be
hard pressed to move anything of that size smoothly -- Rev doesn't do so
well moving large images.  That said, I would try to repeatedly set the
position of the image with short changes in distance in a tight "send..."
loop.  Here's a simple example:

on mouseUp
   moveImage
end mouseUp

on moveImage
   if right of img 1 < 10 then exit moveImage
   set left of img 1 to (left of img 1 - 2)
   send "moveImage" to me in 5 millisecs
end moveImage

This makes for substantial processor use, but also makes for smoother move
effects.

Another option I would try is to move the physical position of the stack in
which the image appears across the desktop, instead of moving the image
within the stack.  Sometimes movement of a stack window can appear smooth,
perhaps because the system is responsible for blending the window with the
desktop, I'm not sure.  But if image movement doesn't work out well for you,
I'd try moving the stack.

Hope this helps.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design





More information about the use-livecode mailing list