Vanilla JS
You can use TegakiEngine directly with plain JavaScript or TypeScript, without a framework.
Installation
Section titled “Installation”npm install tegakipnpm add tegakiyarn add tegakibun add tegakiBasic example
Section titled “Basic example”The engine creates its DOM elements inside the container.
Updating options
Section titled “Updating options”Call update() to change text, font, time, or plugins at any time:
Controlled time
Section titled “Controlled time”Pass a number to time and update it on each frame:
Plugins
Section titled “Plugins”Glows, gradients, tapered ends and the rest are plugins. Import the factories from tegaki/core and pass the plugins in a list:
Register a factory and plugins can name it, with or without options. That’s handy when the list comes from data (a JSON config, a data- attribute):
See Style plugins and Naming plugins. The pressure option (0 to 1, default 1) sets how much the ink’s width follows the pen’s pressure.
Cleanup
Section titled “Cleanup”Call destroy() when you’re done to remove event listeners and stop the animation loop:
Font registration
Section titled “Font registration”Register bundles globally so you can reference them by name:
Pre-rendering (SSR)
Section titled “Pre-rendering (SSR)”Use TegakiEngine.renderElements() to produce the element tree on the server, then adopt it on the client:
This is what all framework adapters use internally.