Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/dwm/examples/clock/dotPool.ts

Deno Window Manager: Cross-platform window creation and management
Go to Latest
import * as dwm from "https://deno.land/x/dwm@0.3.4/examples/clock/dotPool.ts";

Variables

Here we draw a dot(circle) on the screen (canvas). This method is used to create our 'static' time-value 'numbers' and 'colons' on the screen. These are rendered as simple circles.

The main entry point for DotPool animations. (called from the ClockFace animation loop 'ClockFace.tick()'). ClockFace.tick() is triggered by window.requestAnimationFrame(). We would expect ~ 60 frames per second here.

Functions

Activates a dot-pool index, to create a new animated dot. Whenever a time-number change causes one or more dots to be 'freed' from the number display, we animated them as if they exploded out of the number display. We do this by activating the next available index, setting its position to the position of the freed-dot, and then assigning a random velocity to it. If we have activated the array index pointed to by tailPointer, we increment the tailPointer to maintain our active pool size.

Initializes all DotPool value arrays.