Debian Codegraph @

docs/manual/Demo_window_6__Animation.html

raw
1 <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2 <title>Demo window 6. Animation</title>
3 <style>
4 td { padding-left: 5pt; padding-right: 5pt; }
5 th { padding-left: 5pt; padding-right: 5pt; }
6 code { white-space: pre-wrap; }
7 dd { white-space: pre-wrap; }
8 </style>
9 </head><body bgcolor="#FFFFFF">
10
11 <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b>
12 Demo window 6. Animation
13 </b></font></table></table>
14 <p>In the above examples, things will often get drawn to the screen with some delay, i.e., you may not see the erasures and paintings happen. This is because several operating systems use <i>buffering</i> of graphics. These systems will draw the graphics only just before getting user input. This means that <a href="_demoWaitForInput_.html"><b><code><font size=+1>demoWaitForInput</font></code></b></a> is the place where your drawings will typically be painted on the screen. If you want painting to happen earlier (e.g. in animations), you can use</p>
15 <code> <b><a href="_demoShow_.html">demoShow</a></b> ()<br></code>
16 <p>Also in animations, you will often want to regulate the time span between two consecutive drawings. If you want 0.05 seconds between drawings, you can put Praat to sleep temporarily with</p>
17 <code> <b><a href="_sleep_.html">sleep</a></b> (0.05)<br></code>
18 <p>If you need user input during the animation, you can replace <a href="_demoWaitForInput_.html"><b><code><font size=+1>demoWaitForInput</font></code></b></a> or <b><code><font size=+1>demoShow</font></code></b> with</p>
19 <code> <b><a href="_demoPeekInput_.html">demoPeekInput</a></b>()<br></code>
20 <p>which returns immediately without waiting and will tell you (via e.g. <a href="_demoClicked_.html"><b><code><font size=+1>demoClicked</font></code></b></a> or <a href="_demoKey-S_.html"><b><code><font size=+1>demoKey$</font></code></b></a>) whether a mouse or key event happened during drawing or sleeping.</p>
21 <h3>Links to this page</h3>
22 <ul>
23 <li><a href="Demo_window.html">Demo window</a>
24 </ul>
25 <hr>
26 <address>
27 <p>© Paul Boersma 2009–2023</p>
28 </address>
29 </body>
30 </html>