You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by cmckay <ca...@couchware.ca> on 2008/02/14 09:02:09 UTC

setInterval animation question

Hi,

I'm currently trying to make a game using Batik and am having some trouble
with the animation system.

My initial attempt involved making timed changes to the DOM via the update
manager. The general structure being:

Runnable r = new Runnable() { ... changes to the DOM ... };
updateManager.invokeLater(r);
waitFor10ms();
Runnable r = new Runnable() { ... changes to the DOM ... }
updateManager.invokeLater(r);
etc.

However, I've found this structure to be unsatisfactory due to the fact that
when lots of stuff is going on, the update manager queue loads up and you
lose the 10 ms delay between each frame.

My next idea was to use the Window.setInterval() method to schedule
animations.  What I tried was using setInterval to schedule a custom
animation runnable to run every 10 ms and change the DOM.  However, I found
that if I didn't use the update manager in the animation runnable, I'd get
graphical glitches.  Thus, by having to add the animation updates to the
update manager queue, I feel like I'm back to my first problem, with the
only difference being that I'm using setInterval to schedule instead of
waitFor10ms().  Will using setInterval() improve my animation performance?

What is the best way to animate SVG using Batik?  Would using SMIL be a
better option?

Thanks,
Cameron
-- 
View this message in context: http://www.nabble.com/setInterval-animation-question-tp15475683p15475683.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org