⚡ Real-time performance
Blazing fast ASCII conversion powered by an optimized WebGL rendering pipeline specifically designed for textmode art.
A creative coding library for building dynamic ASCII art and textmode graphics with real-time* rendering
textmode.js
? textmode.js is a free, lightweight, and framework-agnostic creative-coding library for real‑time ASCII and textmode graphics in the browser. It combines a grid‑based API with a modern WebGL2
pipeline, multiple render targets, and aggressive instanced rendering to deliver smooth, high‑performance rendering.
The library is designed to be easy to use and accessible to developers of all skill levels. Whether you're a seasoned developer or just starting out, textmode.js
provides a simple and intuitive API that makes it easy to create stunning textmode art and animations.
Get up and running with textmode.js
in just a few steps:
Install the library:
npm install textmode.js
Create your first sketch:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>textmode.js sketch</title>
</head>
<body>
<script type="module" src="./sketch.js"></script>
</body>
</html>
import { textmode } from 'textmode.js';
const t = textmode.create({
width: window.innerWidth,
height: window.innerHeight,
fontSize: 16,
frameRate: 60
});
t.setup(() => {
// Optional setup code here (e.g., load fonts/shaders, initialize variables that access 't')
});
t.draw(() => {
t.background(32); // Dark gray background
t.char('A');
t.charColor(255, 0, 0); // Cover the top-left quarter of the grid with a rectangle of red 'A's
t.rect(0, 0, t.grid.cols / 2, t.grid.rows / 2);
// ...add your drawing code here!
});
t.windowResized(() => {
t.resizeCanvas(window.innerWidth, window.innerHeight);
});
That’s it! With textmode.js
set up and running, you can start creating your own ASCII art and textmode experiences.
INFO
For alternative installation methods, including CDN usage, check out the installation guide.
For advanced usage and customization, see the API documentation.
Experience textmode.js
in action with some interactive demos:
Join our growing community of creative developers:
Check out our API documentation and examples to begin your textmode journey.