Countdown Scene
Sometimes the participant sees a countdown before the assessment starts. The countdown begins at a specified number and counts down to zero.
The CountdownScene
class makes it easy to create a countdown scene. The single required property is milliseconds
, which is the number of milliseconds to count down from.
Customizing the countdown scene
The default countdown is white numbers in a blue circle with the text "GET READY" below it. When the countdown reaches zero, there is a slide transition to the next scene.
You can customize the countdown scene using additional properties in CountdownSceneOptions. These options change the timer shape (circle or rectangle) and color, fonts, text, positioning, and more. CountdownSceneOptions
extends SceneOptions
, so you can add other scene options, too.
Why is the example text so small? A CountdownScene
does not work on very small assessment screen sizes. In the hidden boilerplate code, this example uses a 400 x 800 assessment size. This is then scaled down on the page for the 200 x 400 space allocated to it.
- Depending on the assessment, you may not want a slide transition to the next scene; perhaps the next scene has a fixation cross that should not move. To do this, set the
transition
property toTransition.none()
. However, this will cause the "0" number to show for only one frame before the next scene appears, which is undesirable. The propertyzeroDwellMilliseconds
is the time the scene will pause on zero before moving to the next scene. This will replace a flickering "0" with one that pauses for the given time.