Creates a banner on the given canvas and begins observing its size and visibility. Call setup before spawning text to load the font.
Canvas on which the banner is rendered.
URL of the font used to create the character, supports only WOFF/OTF/TTF type font and not WOFF2.
Color used when initializing the character cache.
Font size used to build character polygons.
Locale used to split text into grapheme clusters.
Safely destroys this class by stoping the physics loop and releases the event listeners and observers. Automatically called when this class is disposed.
true makes the entities bounce at the edges; false makes them loop at edges.
Whether debug rendering should be enabled.
Starts the physics loop if it is not already running.
Gravity acceleration; zero to disable gravity.
Magnitude of the initial shooting velocity.
Characters that are picked randomly to be shot at.
Loads the configured font into the character polygon cache.
Fires a random character inward from the screen.
Spawns a single character at a position with the given velocity.
Initial horizontal center position.
Initial vertical center position.
Character to spawn.
Initial horizontal velocity.
Initial vertical velocity.
Spawns the characters into the physics world.
Text to spawn.
Horizontal placement from 0 (left) to 1 (right) and 0.5 is the center.
Vertical placement from 0 (top) to 1 (bottom) and 0.5 is the center.
Alignment of each line within the text block. Text is lined up along the left, center, right margin.
Stops the physics loop while leaving the banner ready to resume.
Rigid body physics simulation for ascii art/text. Uses opentype.js to get character paths from a font. Supports gravity, collisions, boundary behavior, and optional debugging.