diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex | 238 |
1 files changed, 191 insertions, 47 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex index 7ac5b4f795e..85adcf9024b 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex @@ -11,6 +11,7 @@ \section{Animation System Layer} \label{section-pgfsys-anim} +\begin{codeexample}[setup code,hidden] \makeatletter \def\animationexample#1#2#3{% @@ -24,6 +25,7 @@ (node) {Click \\ here}; }% } +\end{codeexample} In conjunction with the right output format (namely \textsc{svg}), you can specify that certain parts of you graphics can be animated. For this, there are @@ -159,7 +161,9 @@ driver implements): % Now the example, where the circle will disappear, when clicked: % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalscalar{1} @@ -213,7 +217,7 @@ The ``opposite'' of |\pgfsysanimate| is the following command: numerically stable. \end{enumerate} % -\begin{codeexample}[width=5cm] +\begin{codeexample}[width=5cm,preamble={\usetikzlibrary{animations}}] \foreach \t in {0.5,1,1.5,2} { \pgfsysanimsnapshot{\t} \tikz { @@ -257,7 +261,10 @@ visibility, and opacity. Specify values with |\pgfsysanimvalscalar|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalscalar{1} @@ -274,7 +281,10 @@ visibility, and opacity. Specify values with |\pgfsysanimvalscalar|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalscalar{1} @@ -291,7 +301,10 @@ visibility, and opacity. Specify values with |\pgfsysanimvalscalar|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalscalar{1} @@ -309,7 +322,10 @@ visibility, and opacity. Specify values with |\pgfsysanimvaltext|. However, only two values are allowed: |visible| and |hidden|. % -\begin{codeexample}[animation list={-1,0,1,2,3}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={-1,0,1,2,3}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltext{hidden} @@ -326,7 +342,10 @@ visibility, and opacity. Specify values with |\pgfsysanimvalcolorrgb| and friends. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalcolorrgb{0}{0}{0} @@ -343,7 +362,10 @@ visibility, and opacity. Specify values with |\pgfsysanimvalcolorrgb| and friends. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalcolorrgb{0}{0}{0} @@ -369,7 +391,11 @@ The following attributes influence paths and how they are rendered. Specify values with |\pgfsysanimvalpath|. % -\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(0.9,-0.1)rectangle(2.1,1.1)}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, + animation bb={(0.9,-0.1)rectangle(2.1,1.1)}, +] \animationexample{my path}{path}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalpath{\pgfsys@moveto{1cm}{0cm}% @@ -396,7 +422,7 @@ The following attributes influence paths and how they are rendered. |\pgfsetarrows| and then animate the path, you will get an error message. \item Internally, the arrow tips that ``rotate and move along'' are - drawn using so-called \emph{markers.} These are little graphic + drawn using so-called \emph{markers}. These are little graphic objects that can be added to the start and end of paths and that are automatically rotated and move along with the path. @@ -464,7 +490,11 @@ The following attributes influence paths and how they are rendered. animations may use different arrow tips / markers. This allows you to animate (change) which arrow tip is used on a path over time. % -\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(0.7,-0.3)rectangle(2.3,1.3)}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, + animation bb={(0.7,-0.3)rectangle(2.3,1.3)}, +] % Declare a marker: \pgfsys@marker@declare\mymarker{% \pgfscope% @@ -503,7 +533,10 @@ The following attributes influence paths and how they are rendered. Specify values with |\pgfsysanimvaldimension|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaldimension{1pt} @@ -520,7 +553,10 @@ The following attributes influence paths and how they are rendered. Specify values with |\pgfsysanimvaldash|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaldash{1pt,10pt}{0pt} @@ -530,7 +566,10 @@ The following attributes influence paths and how they are rendered. } \end{codeexample} % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaldash{1cm,1pt}{0pt} @@ -540,7 +579,10 @@ The following attributes influence paths and how they are rendered. } \end{codeexample} % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaldash{3pt,1pt}{0pt} @@ -612,7 +654,7 @@ first. in two seconds and rotates the blue ball over 90$^\circ$ around the origin. The ball is placed at $(1,0)$. % -\begin{codeexample}[code only] +\begin{codeexample}[code only,setup code] \def\animationcanvasexample#1#2{% \animationexample{ball}{}{% \pgfsysanimkeycanvastransform{#1}{#2}% @@ -632,6 +674,8 @@ first. \fill [ball color=blue,name=ball] (1,0) circle [radius=3mm]; } } \end{codeexample} % +% TODOsp: codeexamples: this definition is needed for the next 4 `codeexample`s +% but because of the hash sign it can't simply be added `pre` \def\animationcanvasexample#1#2{% \animationexample{ball}{}{% \pgfsysanimkeycanvastransform{#1}{#2}% @@ -650,26 +694,42 @@ first. \pgfsysanimate{rotate} \fill [ball color=blue,name=ball] (1,0) circle [radius=3mm]; } } -\begin{codeexample}[width=9.9cm,animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + width=9.9cm, + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationcanvasexample {} {} \end{codeexample} % -\begin{codeexample}[width=9.9cm,animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + width=9.9cm, + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationcanvasexample {\pgfsys@transformshift{10mm}{0mm}} {\pgfsys@transformshift{-10mm}{0mm}} \end{codeexample} % -\begin{codeexample}[width=9.9cm,animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + width=9.9cm, + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationcanvasexample {\pgfsys@transformcm{0.5}{0.5}{-0.5}{0.5} {0pt}{0pt}} {} \end{codeexample} % -\begin{codeexample}[width=9.9cm,animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + width=9.9cm, + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationcanvasexample {\pgfsys@transformcm{0.5}{0.5}{-0.5}{0.5} {0pt}{0pt}} @@ -685,7 +745,10 @@ first. Specify values with |\pgfsysanimvaltranslate|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm}% @@ -703,7 +766,10 @@ first. Specify values with |\pgfsysanimvalscale|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalscale{1}{1}% @@ -720,7 +786,10 @@ first. Specify values with |\pgfsysanimvalscalar|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, + ] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalscalar{0}% @@ -738,7 +807,10 @@ first. Specify values with |\pgfsysanimvalscalar|. % -\begin{codeexample}[animation list={0.5,1,1.5,2}] +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalscalar{0}% @@ -782,7 +854,10 @@ first. simply be executed and must call |\pgfsys@lineto| and similar path-construction commands, but should not call other commands. % -\begin{codeexample}[animation list={0.5,1,1.5,2},render instead={ +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, + render instead={ \animationexample{node}{}{ \pgfsysanimkeymovealong{ \pgfsyssoftpath@movetotoken{0pt}{0pt} @@ -829,7 +904,10 @@ first. so that it points along the path as time progresses. This option is only applicable to motion animations. % -\begin{codeexample}[animation list={0.5,1,1.5,2},render instead={ +\begin{codeexample}[ + preamble={\usetikzlibrary{animations}}, + animation list={0.5,1,1.5,2}, + render instead={ \animationexample{node}{}{ \pgfsysanimkeyrotatealong \pgfsysanimkeymovealong{ @@ -871,8 +949,12 @@ first. Specify values with |\pgfsysanimvalviewbox|. % -\begin{codeexample}[animation list={0.5,1,1.5,2},width=5cm,animation - bb={(0.9,-2.1) rectangle (3.1,2.1)}] +\begin{codeexample}[ + width=5cm, + preamble={\usetikzlibrary{animations,views}}, + animation list={0.5,1,1.5,2}, + animation bb={(0.9,-2.1) rectangle (3.1,2.1)}, +] \animationexample{my view}{view}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvalviewbox{-10mm}{-20mm}{10mm}{20mm}% @@ -1122,7 +1204,11 @@ that must be used). Specifies that the animation should repeat the specified \meta{number of times}, which may be a fractional number. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm] +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1139,7 +1225,11 @@ that must be used). \begin{command}{\pgfsys@animation@repeat@indefinite} Specifies that the animation should repeat indefinitely. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm] +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1157,7 +1247,11 @@ that must be used). Specifies that the animation should repeat until \meta{seconds} have elapsed. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm] +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1199,8 +1293,11 @@ possible beginnings (or endings). after the graphic is shown. For instance, in the next example the animation will start automatically after 5\,s \emph{or} when then button is pressed. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm,render - instead={ +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +render instead={ \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1259,7 +1356,10 @@ possible beginnings (or endings). onto the object, moved over the object, or moved off the object. \end{itemize} % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1269,7 +1369,10 @@ possible beginnings (or endings). \pgfsysanimate{translate} } \end{codeexample} % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1279,7 +1382,10 @@ possible beginnings (or endings). \pgfsysanimate{translate} } \end{codeexample} % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1289,7 +1395,10 @@ possible beginnings (or endings). \pgfsysanimate{translate} } \end{codeexample} % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1299,7 +1408,10 @@ possible beginnings (or endings). \pgfsysanimate{translate} } \end{codeexample} % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1317,7 +1429,11 @@ possible beginnings (or endings). The animation begins (or end) with a certain offset when another animation has reached a certain repeat count. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm] +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1350,7 +1466,10 @@ possible beginnings (or endings). event may not be supported by some browsers for security reasons (prevent key loggers). % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1372,7 +1491,10 @@ possible beginnings (or endings). Defines that the animation can be restarted at any time. This is the default. % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1389,7 +1511,10 @@ possible beginnings (or endings). \begin{command}{\pgfsys@animation@restart@never} Defines that the animation cannot be restarted once it has run. % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1406,7 +1531,10 @@ possible beginnings (or endings). \begin{command}{\pgfsys@animation@restart@whennotactive} Defines that the animation cannot be restarted while it is running. % -\begin{codeexample}[width=2cm] +\begin{codeexample}[ + width=2cm, + preamble={\usetikzlibrary{animations}}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1427,7 +1555,11 @@ possible beginnings (or endings). at the end of the animation the last value of the attributes stays in effect. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm] +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1444,7 +1576,11 @@ possible beginnings (or endings). \begin{command}{\pgfsys@animation@removeatend{}} The opposite of |\pgfsysanimkeyfreezeatend|. This is the default. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm] +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1471,7 +1607,11 @@ during each repeat the values can add up: Specifies that each repeat of an animation works as if the last values attained during previous repeats are added to the current value. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm] +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} @@ -1490,7 +1630,11 @@ during each repeat the values can add up: Specifies that each repeat resets the to-be-animated value. This is the default. % -\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm] +\begin{codeexample}[ + width=6cm, + preamble={\usetikzlibrary{animations}}, + animation list={1,2,3,4,5,6,7,8}, +] \animationexample{node}{}{ \pgfsysanimkeytime{0}{1}{1}{0}{0} \pgfsysanimvaltranslate{0cm}{0cm} |