SkillAgentSearch skills...

Spritejs

A cross platform high-performance graphics system.

Install / Use

/learn @spritejs/Spritejs
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"> <a href="http://spritejs.com"><img src="https://p2.ssl.qhimg.com/t01e6920579715cc92b.jpg" alt="spritejs logo"/></a> </p>

<a href="http://spritejs.com"><h1 align="center">spritejs.com</h1></a>

npm status build status Package Quality Maintainability License

Spritejs is a cross platform high-performance graphics system, which can render graphics on web, node, desktop applications and mini-programs.

Spritejs<sup>Next</sup> is the new version of spritejs. It is renderer agnostic enabling the same api to render in multiple contexts: webgl2, webgl, and canvas2d.

Manipulate the sprites in canvas as you do with the DOM elements.

Features

  • Manipulate the sprites element as you do with the DOM elements.
  • Rendering by WebGL2 context.
  • Multiple layers.
  • DOM Events.
  • Object Oriented Programmed Development with ES6+.
  • OffscreenCanvas and Web Worker.
  • Work with d3.
  • Server-side rendering.
  • Vue.

Quick Start

SpriteJS - spritejs.com

<script src="https://unpkg.com/spritejs@3/dist/spritejs.min.js"></script>
<div id="container" style="width:400px;height:400px"></div>
<script>
    const imgUrl = 'https://s5.ssl.qhres2.com/static/ec9f373a383d7664.svg'
    const {Scene, Sprite} = spritejs;
    const container = document.getElementById('container');
    const paper = new Scene({
      container,
      width: 400,
      height: 400,
    })

    const sprite = new Sprite(imgUrl)
    sprite.attr({
      bgcolor: '#fff',
      pos: [0, 0],
      size: [400, 400],
      borderRadius: '200'
    })

    paper.layer().appendChild(sprite)
</script>
<div style="font-size: 1.5rem">Learn more at <strong style="font-size: 2.5rem"><a href="http://spritejs.com/"><font size="36">spritejs.com</font></a></strong> </div>

Usage

In browser:

<script src="https://unpkg.com/spritejs@3/dist/spritejs.min.js"></script>

With Node.js:

npm install spritejs --save
import * as spritejs from 'spritejs';

3D

SpriteJS<sup>Next</sup> can render 3D elements through 3D extension library.

<script src="https://unpkg.com/spritejs@3/dist/spritejs.es.min.js"></script>
<script src="https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.js"></script>

Or from NPM

import {Scene} from 'spritejs';
import {Cube, shaders} from 'sprite-extend-3d';

Examples

Basic

With D3

Compatible with d3.js.

3D Extension

Q-Charts

A visulization library based on spritejs.

<!-- ### With Proton [Proton](https://github.com/a-jie/Proton) is a lightweight and powerful javascript particle engine. - [Big Fire](http://spritejs.com/demo/#/proton/fire) - [Background Particles](http://spritejs.com/demo/#/proton/position) - [Custom Behavior](http://spritejs.com/demo/#/proton/behavior) ### With Matter-js [Matter.js]((https://github.com/liabru/matter-js)) is a JavaScript 2D rigid body physics engine. - [Mixed shapes](http://spritejs.com/demo/#/matterjs/mixed_shapes) -->

Ecosystem & Extensions

| Project | Description | | ------------------------------- | ----------------------------------- | | sprite-vue| SpriteJS for Vue.js. | | sprite-react| Rendering spritejs elements with React. | | q-charts | A visulization library based on spritejs | | cat-charts-vue| A visulization library based on spritejs , qcharts and Vue. |

Architecture

Spritejs<sup>Next</sup> provides several kinds of basic sprite elements, which can be operated on the layer like DOM elements.

架构图

Build

Build with NPM

npm run build

Build Doc

npm run build-doc

Tests

npm test

V2

SpriteJS v2.0

Compatibility

Compatible for most modern browsers.

You should import babel-polyfill for early browers(i.e. iOS 8).

Contributors

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore -->

| | | | | | | | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | <img src="https://avatars2.githubusercontent.com/u/12529206?s=460&v=4" width="60px;"/><br /><sub><b>betseyliu</b></sub><br />💻 📖 | <img src="https://avatars0.githubusercontent.com/u/11631503?s=460&v=4" width="60px;"/><br /><sub><b>Shero0311</b></sub><br />📖 | <img src="https://avatars3.githubusercontent.com/u/16967069?s=460&v=4" width="60px;"/><br /><sub><b>有马</b></sub><br />📖 💻| <img src="https://avatars1.githubusercontent.com/u/8180186?s=400&v=4" width="60px;"/><br /><sub><b>文蔺</b></sub><br />💻 🐛 | <img src="https://avatars3.githubusercontent.com/u/5996758?s=400&v=4" width="60px;"/><br /><sub><b>蔡斯杰</b></sub><br />💻 📖 | <img src="https://avatars2.githubusercontent.com/u/726566?s=400&v=4" width="60px;"/><br /><sub><b>Shaofei Cheng</b></sub><br />💻 📖 | <img src="https://avatars2.githubusercontent.com/u/2947893?s=400&v=4" width="60px;"/><br /><sub><b>摇太阳</b></sub><br />📖
| <img src="https://avatars2.githubusercontent.com/u/424491?s=400&v=4" width="60px;"/><br /><sub><b>公子</b></sub><br />💻 | <img src="https://avatars1.githubusercontent.com/u/26452939?s=400&v=4" width="60px;"/><br /><sub><b>justemit</b></sub><br />💻 📖 🐛 | [<img src="https://avatars2.githubusercontent.com/u/40935?s=400&v=4" width="60px;"/><br /><sub><b>Welefen Lee</b></sub>](https:

Related Skills

View on GitHub
GitHub Stars5.4k
CategoryDevelopment
Updated2d ago
Forks324

Languages

JavaScript

Security Score

100/100

Audited on Apr 5, 2026

No findings