Back to Playground

🎬 Use cinematicRenderer2D in Your Project

Get started in minutes with our high-performance cinematic rendering library

📦 Installation

Install cinematicRenderer2D using your preferred package manager:

npm install cinematic-renderer2d
yarn add cinematic-renderer2d
pnpm add cinematic-renderer2d

🚀 Quick Start

Vanilla JavaScript / TypeScript

import { CinematicRenderer2D } from 'cinematic-renderer2d';

const renderer = new CinematicRenderer2D({
  container: document.getElementById('container'),
  spec: {
    schemaVersion: '1.0.0',
    engine: { targetFps: 60, quality: 'auto' },
    events: [{
      id: 'intro',
      name: 'Introduction',
      scenes: ['welcome']
    }],
    scenes: [{
      id: 'welcome',
      name: 'Welcome Scene',
      duration: 3000,
      layers: [{
        id: 'background',
        type: 'gradient',
        zIndex: 1,
        config: {
          colors: ['#667eea', '#764ba2'],
          direction: 'diagonal'
        }
      }]
    }]
  }
});

// Mount and play
await renderer.mount();
renderer.play();

React

import { CinematicPlayer } from 'cinematic-renderer2d/react';

function App() {
  return (
    <CinematicPlayer
      spec={yourSpec}
      autoplay={true}
      onPlay={() => console.log('Playing')}
      onEnd={() => console.log('Finished')}
    />
  );
}

Angular

import { CinematicPlayerComponent } from 'cinematic-renderer2d/angular';

@Component({
  selector: 'app-root',
  template: `
    <cinematic-player
      [spec]="spec"
      [autoplay]="true"
      (play)="onPlay()"
      (end)="onEnd()">
    </cinematic-player>
  `
})
export class AppComponent {
  spec = { /* your spec */ };
}

✨ Key Features

🚀 High Performance

60-120fps with optimized rendering backends

🎯 Framework Agnostic

Works with React, Angular, Vue, or vanilla JS

🎨 Multiple Backends

DOM and Canvas2D rendering support

📱 Adaptive Quality

Automatic performance optimization

🎵 Audio Integration

Synchronized audio tracks with fade effects

🔧 TypeScript

Full type safety and auto-completion

📚 Next Steps

💡 Example Specifications

The playground includes several example specifications you can use as starting points:

Load these examples in the playground to see how they work, then customize them for your needs!

🆘 Need Help?