在 animate 包中巧妙设置 \multiframe 以适应不同的条件

在 animate 包中巧妙设置 \multiframe 以适应不同的条件

我正在尝试使用 PSTricks 预定义数字设置一个动画计数器。让它最多工作 18 帧。但是当增加帧数时,我无法足够巧妙地处理它。我想对于专家来说没问题...

我使用该包设置了一个基于 PSTricks 的绘制数字数组xint,并将 10 个绘制的数字移入该数组:\digits

\digits{1}给出绘制的数字“0” \digits{2}给出绘制的数字“1” ... \digts{10}给出绘制的数字“9”

\digits{0}给出定义数组内的元素数量......

现在,在\multiframe命令中,我试图巧妙地让数字出现并将其提升到 18 帧,然后我让它变得更好的想法就消失了......

这里是代码:

% arara: latex
% arara: latex
% arara: dvisvgm : {options: ['exact', 'font-format=woff', 'zoom=-1']}
\documentclass[%
%dvisvgm,
]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr}
\pagestyle{empty}

\begin{document}
\definecolor{digits}{rgb}{0,0,0}  % BLACK
%\definecolor{digits}{HTML}{FF7F00} % ORANGE
%\definecolor{digits}{rgb}{0.79,0.255,0.329} % BRICKRED

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}

%% Bringing the digits into an array with 10 elements: 1, 2, 3, 4, ..., 9, 0
%% \digits{1} = spies out the digit 0, \digits{9} = spies aout digit 8, \digits{10} = spies out digit 9, 
%% \digits{0} = spies out the number of elements = 10
\xintAssignArray{%
{% 0
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}
{% 1
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
}
{% 2
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 3
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 4
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 5
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 6
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 7
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}
{% 8
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 9
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
}\to\digits

\begin{center}
\begin{animateinline}[%
    controls,
    palindrome,
    begin={\begin{pspicture*}(-2,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
%% Works up to 18 frames then the modulo 10 sets second digit to zero which means it takes the number of the
%% above defined array -- which outputs the number of elements within the array and not the wanted digit ... EUF!!! 
\multiframe{18}{iA=1+1}{%
\xintifbooliiexpr{\iA<10}%
{\rput(0,0){\pstilt{85}{\digits{\iA+1}}}}%
{\rput(0,0){\pstilt{85}{\digits{2}}}\rput(1.75,0){\pstilt{85}{\digits{\xinttheiiexpr (\iA+1)/:10\relax}}}}
}
\end{animateinline}
\end{center}
\end{document}

到目前为止的动画如下:

在此处输入图片描述

任何帮助都值得感激!

答案1

您对此有何看法?

\documentclass[%
]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0,0}  % BLACK
%\definecolor{digits}{HTML}{FF7F00} % ORANGE
%\definecolor{digits}{rgb}{0.79,0.255,0.329} % BRICKRED

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}

%% Bringing the digits into an array with 10 elements: 1, 2, 3, 4, ..., 9, 0
%% \digits{1} = spies out the digit 0, \digits{9} = spies aout digit 8, \digits{10} = spies out digit 9,
%% \digits{0} = spies out the number of elements = 10
\xintAssignArray{%
{% 0
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}
{% 1
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
}
{% 2
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 3
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 4
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 5
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 6
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 7
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}
{% 8
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 9
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
}\to\digits

\begin{center}
\begin{animateinline}[%
    controls,
    palindrome,
    begin={\begin{pspicture*}(-2,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
%% Works up to 18 frames then the modulo 10 sets second digit to zero which means it takes the number of the
%% above defined array -- which outputs the number of elements within the array and not the wanted digit ... EUF!!!
\multiframe{131}{iA=0+1}{%
%\xintifbooliiexpr{\iA<10}%
%{\rput(0,0){\pstilt{85}{\digits{\iA+1}}}}%
%    {%
    \rput(-1.75,0){\pstilt{85}{\digits{\xinttheexpr (1+floor(\iA/100))/:10\relax}}}
    \rput(0,0){\pstilt{85}{\digits{\xinttheexpr (1+floor(\iA/10))/:10\relax}}}%
    \rput(1.75,0){\pstilt{85}{\digits{\xinttheiiexpr 1+(\iA/:10)\relax}}}%
%    }%
}
\end{animateinline}
\end{center}
\end{document} 

第二种情况:

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0,0}  % BLACK

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}

\newcommand{\digitJG}[1]{
\ifcase#1
%Zero case.
\digitZ
\or %case 1
\digitI
\or %case 2
\digitII
\or %case 3
\digitIII
\or %case 4
\digitIV
\or %case 5
\digitV
\or %case 6
\digitVI
\or %case 7
\digitVII
\or %case 8
\digitVIII
\or %case 9
\digitIX
\else
Okay,thats crazy!\\
\fi
}

\def\digitZ{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}

\def\digitI{%
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
}

\def\digitII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIII{%
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIV{%
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitV{%
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVI{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVII{%
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
}

\def\digitVIII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIX{%
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\begin{center}
\begin{animateinline}[%
    controls,
%    palindrome,
    begin={\begin{pspicture*}(-2,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
\multiframe{61}{iA=60+-1}{%
\xintifbooliiexpr{\iA=0}%
{\rput(0,0){\pstilt{85}{\textcolor{red}{\bfseries\LARGE READY!}}}}%
    {%
    \rput(-1.75,0){\pstilt{85}{\digitJG{\xinttheexpr (floor(\iA/100))/:10\relax}}}
    \rput(0,0){\pstilt{85}{\digitJG{\xinttheexpr (floor(\iA/10))/:10\relax}}}%
    \rput(1.75,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA/:10)\relax}}}%
    }%
}
\end{animateinline}
\end{center}
\end{document}

变体

点击查看实际效果

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0.8,0.2}  % BLACK
\definecolor{digitsI}{rgb}{0.15,0.15,0.15}  % BLACK

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}
\newpsstyle{digitsI}{linewidth=0.5pt,fillstyle=solid,fillcolor=digitsI,linecolor=digitsI,opacity=0.3}%linestyle=none,

\newcommand{\digitJG}[1]{
\ifcase#1
%Zero case.
\digitZ
\or %case 1
\digitI
\or %case 2
\digitII
\or %case 3
\digitIII
\or %case 4
\digitIV
\or %case 5
\digitV
\or %case 6
\digitVI
\or %case 7
\digitVII
\or %case 8
\digitVIII
\or %case 9
\digitIX
\else
Okay,thats crazy!\\
\fi
}

\def\digitZ{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitI{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digitsI](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIII{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIV{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitV{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVI{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVII{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVIII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIX{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\begin{center}
\begin{animateinline}[%
    controls,
%    palindrome,
    begin={\begin{pspicture*}(-4,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
\multiframe{61}{iA=60+-1}{%
\psframe*(-4,-1)(5,3)
\xintifbooliiexpr{\iA=0}%
{\rput(0.5,1){\pstilt{85}{\textcolor{red}{\bfseries\LARGE READY!}}}}%
    {%
    \rput(-1.75,0){\pstilt{85}{\digitJG{\xinttheexpr (floor(\iA/100))/:10\relax}}}
    \rput(0,0){\pstilt{85}{\digitJG{\xinttheexpr (floor(\iA/10))/:10\relax}}}%
    \rput(1.75,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA/:10)\relax}}}%
    }%
}
\end{animateinline}
\end{center}
\end{document} 

现在是24小时

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0.8,0.2}  % green
\definecolor{warning}{HTML}{FF7F00}   % orange
\definecolor{digitsI}{rgb}{0.15,0.15,0.15}  % dark gray

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}
\newpsstyle{digitsI}{linewidth=0.5pt,fillstyle=solid,fillcolor=digitsI,linecolor=digitsI,opacity=0.95}%linestyle=none,

\newcommand{\digitJG}[1]{
\ifcase#1
%Zero case.
\digitZ
\or %case 1
\digitI
\or %case 2
\digitII
\or %case 3
\digitIII
\or %case 4
\digitIV
\or %case 5
\digitV
\or %case 6
\digitVI
\or %case 7
\digitVII
\or %case 8
\digitVIII
\or %case 9
\digitIX
\else
Okay,thats crazy!\\
\fi
}

\def\digitZ{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitI{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digitsI](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIII{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIV{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitV{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVI{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVII{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitVIII{%
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\def\digitIX{%
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}

\begin{center}
\begin{animateinline}[%
    controls,
%    palindrome,
    begin={\begin{pspicture*}(-9,-1)(5,3)\psframe*(-9,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
\multiframe{30}{iA=86370+1}{%
    \rput(-7.0,0){\pstilt{85}{\digitJG{\xinttheiiexpr ((\iA//3600)/:24)//10\relax}}}
    \rput(-5.25,0){\pstilt{85}{\digitJG{\xinttheiiexpr ((\iA//3600)/:24)/:10\relax}}}
    \xintifbooliiexpr{\iA/:2=0}{\rput(-3.65,1){\pstilt{85}{\Huge \color{gray!30} :}}}{}%      colon every second frame
    \rput(-3.5,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA//600)/:6\relax}}}
    \rput(-1.75,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA//60)/:10\relax}}}
    \xintifbooliiexpr{\iA/:2=0}{\rput(-0.15,1){\pstilt{85}{\Huge \color{gray!30} :}}}{}%      colon every second frame
    \rput(0,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA//10)/:6\relax}}}%
    \rput(1.75,0){\pstilt{85}{\digitJG{\xinttheiiexpr (\iA/:10)\relax}}}%
}
\newframe
\rput(-2,1){\pstilt{85}{\textcolor{warning}{\textsf{\bfseries\Huge Only 24 hours!}}}}%
\end{animateinline}
\end{center}
\end{document}

在此处输入图片描述

答案2

@Thomas 答案的一个变体,删除了所有需要的xintexpr用法xinttools

由于我不知道的原因,将倒计时起始设置为 118 而不是 117,会出现 TeX 容量超出错误。这与 xint 无关...

% avec shell-escape

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xinttools}
\pagestyle{empty}

\begin{document}

\definecolor{digits}{rgb}{0,0.8,0.2}  % BLACK
\definecolor{digitsI}{rgb}{0.15,0.15,0.15}  % BLACK

\newpsstyle{digits}{linewidth=0.5pt,fillstyle=solid,fillcolor=digits,linecolor=digits}
\newpsstyle{digitsI}{linewidth=0.5pt,fillstyle=solid,fillcolor=digitsI,linecolor=digitsI,opacity=0.3}%linestyle=none,

\xintAssignArray{%
{% 0
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 1
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 2
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digitsI](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 3
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 4
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digitsI](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 5
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 6
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digitsI](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 7
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digitsI](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digitsI](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digitsI](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 8
\pspolygon[style=digits](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}
{% 9
\pspolygon[style=digitsI](0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)%lu
\pspolygon[style=digits](0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)%lo
\pspolygon[style=digits](1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)%ru
\pspolygon[style=digits](1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)%ro
\pspolygon[style=digits](0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)%u
\pspolygon[style=digits](0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)%o
\pspolygon[style=digits](0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)%m
}}\to\JGDIGITS

\begin{center}
\begin{animateinline}[%
    controls,
%    palindrome,
    begin={\begin{pspicture*}(-4,-1)(5,3)},
    end={\end{pspicture*}}
    ]{2}% frame rate = 2 image/s
  \multiframe{117}{iA=117+-1}{% but "TeX capacity exceeded" with 118 :((
    \psframe*(-4,-1)(5,3)
    \xintDigitsOf\the\numexpr 1000+\iA\relax\to\JGdigits  % 4 digits, first=1
    \rput(-1.75,0){\pstilt{85}{\JGDIGITS{1+\JGdigits{2}}}}%  hundreds
    \rput(0,0){\pstilt{85}{\JGDIGITS{1+\JGdigits{3}}}}%      decades
    \rput(1.75,0){\pstilt{85}{\JGDIGITS{1+\JGdigits{4}}}}%   units
  }%
  \newframe
  \psframe*(-4,-1)(5,3)%
  \rput(0.5,1){\pstilt{85}{\textcolor{red}{\bfseries\LARGE READY!}}}
\end{animateinline}
\end{center}
\end{document}

答案3

托马斯解决方案的稍短版本:

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add}
\usepackage{animate}
\usepackage{xintexpr,xintgcd}
\pagestyle{empty}
\makeatletter\let\Digit\@nameuse\makeatother    
\definecolor{digits}{rgb}{0,0,0}  % BLACK   
\psset{linewidth=0.5pt,linecolor=digits}

\begin{document}
\def\BL{\pspolygon*(0,0)(0.1,0.1)(0.1,0.9)(0,1)(0,0)}
\def\TL{\pspolygon*(0,1.1)(0.1,1.2)(0.1,2)(0,2.1)(0,1.1)}
\def\BR{\pspolygon*(1.3,0)(1.2,0.1)(1.2,0.9)(1.3,1)(1.3,0)}
\def\TR{\pspolygon*(1.3,1.1)(1.2,1.2)(1.2,2)(1.3,2.1)(1.3,1.1)}
\def\B{\pspolygon*(0.05,-0.05)(1.25,-0.05)(1.13,0.07)(0.17,0.07)(0.05,-0.05)}
\def\T{\pspolygon*(0.05,2.16)(1.25,2.16)(1.13,2.05)(0.17,2.05)(0.05,2.16)}
\def\M{\pspolygon*(0.05,1.05)(0.12,0.98)(1.18,0.98)(1.25,1.05)(1.18,1.12)(0.12,1.12)(0.05,1.05)}

\def\0{\BL\TL\BR\TR\B\T}    \def\1{\BR\TR}
\def\2{\BL\TR\B\T\M}        \def\3{\BR\TR\B\T\M}
\def\4{\TL\BR\TR\M}         \def\5{\TL\BR\B\T\M}
\def\6{\BL\TL\BR\B\M}       \def\7{\BR\TR\T}
\def\8{\BL\TL\BR\TR\B\T\M}  \def\9{\TL\BR\TR\B\T\M}

\begin{center}
\begin{animateinline}[controls,
    begin={\begin{pspicture*}(-2,-1)(5,3)},
    end={\end{pspicture*}}]{2}% frame rate = 2 image/s
  \multiframe{61}{iA=60+-1}{%
    \xintifbooliiexpr{\iA=0}%
        {\rput(0,0){\pstilt{85}{\textcolor{red}{\bfseries\LARGE READY!}}}}%
            {\rput(-1.75,0){\pstilt{85}{\Digit{\xinttheexpr 
                (floor(\iA/100))/:10\relax}}}
                \rput(0,0){\pstilt{85}{\Digit{\xinttheexpr (floor(\iA/10))/:10\relax}}}%
                \rput(1.75,0){\pstilt{85}{\Digit{\xinttheiiexpr (\iA/:10)\relax}}}%
            }%
  }
\end{animateinline}
\end{center}
\end{document}

相关内容