ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: MetaPost Animations
Date: Sun, 30 Dec 2012 14:43:14 +0100	[thread overview]
Message-ID: <4D43E412-FC67-443E-A937-9E5CF49EE50F@gmail.com> (raw)
In-Reply-To: <5DC206AE-CC64-4254-972E-852ECD92B0DD@me.com>


Am 30.12.2012 um 14:19 schrieb Jeong Dal <haksan@me.com>:

> Dear Troy,
> 
> The animations are impressive and thank you for sharing the code.
> 
> In the creation of many pdf for animation, it changes the recurselevel only.
> I wonder if there is a way to make such kind of animation in ConTeXt using Wolfgang's animation module.
> Then we can include the animation in PDF output directly.
> 
> Here is my trial.
> 
> I modified it as following and got an animation. But it is only good for a few step animation.
> 
> […]
> 
> I also tried to simplify the code as following, but it just draw 10 figures not an animation.
> Is there a way to combine them as an animation?

You can use a loop to create the frames, the only thing you have to be aware is
how to access the counter loop iteration. In most cases you can get the current
iteration of the loop with \recurselevel but this doesn’t work for animation because
each frame is saved in a symbol with \definesymbol[<frame>][<code>] without
expanding the content.

To fix this you can expand the content with \expanded{\frame{… \recurselevel …}}
or simpler by using “#1” instead of \recurselevel to access the counter.

The braces around each frame as in your example are only one method to set
the content for each frame (it emulates the \startoverlay and \startcombination
input), when you use a loop you have to use \frame{…} or \startframe … \stopframe
to set the content for each frame.


Example:

\usemodule[animation]

\setupinteraction[state=start]

\starttext

\startanimation[menu=yes,framerate=10]
\dorecurse{99}
  {\startframe
   \definedfont[Mono sa 4]\twodigits{#1}%
   \stopframe}
\stopanimation

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2012-12-30 13:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-30 13:19 Jeong Dal
2012-12-30 13:43 ` Wolfgang Schuster [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-01-01 14:30 Jeong Dal
2013-01-01 15:35 ` Wolfgang Schuster
2013-01-07 16:22   ` Troy Henderson
2013-01-07 16:46     ` Marco Patzer
2013-01-07 17:47       ` Rogers, Michael K
2013-01-07 18:24     ` Alan BRASLAU
2013-01-01  3:50 Jeong Dal
2013-01-01  7:48 ` Wolfgang Schuster
2012-12-28 19:41 Troy Henderson
2012-12-28 20:51 ` Otared Kavian
2012-12-28 21:52 ` Hans Hagen
2012-12-28 23:18   ` Rogers, Michael K
2012-12-28 23:49     ` Troy Henderson
2012-12-29  1:02       ` Rogers, Michael K
2012-12-29  2:55         ` Troy Henderson
2012-12-29  3:49           ` Otared Kavian
2012-12-29  3:52             ` Troy Henderson
2012-12-29 12:47           ` Hans Hagen
2012-12-29 15:42           ` Mojca Miklavec
2012-12-29 16:40             ` Peter Münster
2012-12-29 17:07             ` Tom Fossen
2012-12-30  2:57             ` Troy Henderson
2012-12-30 12:43               ` Mojca Miklavec
2012-12-29 12:41         ` Hans Hagen
2005-07-25 22:03 installing context Stuart Jansen
2005-07-25 22:10 ` Hans Hagen
2005-07-26  4:41   ` Adam Lindsay
2005-07-26  5:58     ` metapost:animations luigi.scarso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D43E412-FC67-443E-A937-9E5CF49EE50F@gmail.com \
    --to=wolfgang.schuster@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).