• Stars
    star
    42,581
  • Rank 297 (Top 0.01 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated 8 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.

PixiJS — The HTML5 Creation Engine

pixi.js logo

Discord npm version Node.js CI Financial Contributors

This project aims to provide a fast, lightweight 2D library that works across all devices. The PixiJS renderer allows everyone to enjoy the power of hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.

If you want to keep up to date with the latest PixiJS news then feel free to follow us on Twitter @PixiJS and we will keep you posted! You can also check back on our site as any breakthroughs will be posted up there too!

We are now a part of the Open Collective and with your support you can help us make PixiJS even better. To make a donation, simply click the button below and we'll love you forever!

What to Use PixiJS for and When to Use It

PixiJS is a rendering library that will allow you to create rich, interactive graphics and cross-platform applications and games without having to dive into the WebGL API or deal with browser and device compatibility.

PixiJS has full WebGL support and seamlessly falls back to HTML5's canvas if needed. As a framework, PixiJS is a fantastic tool for authoring interactive content, especially with the move away from Adobe Flash in recent years. Use it for your graphics-rich, interactive websites, applications, and HTML5 games. Out-of-the-box, cross-platform compatibility and graceful degradation mean you have less work to do and more fun doing it! If you want to create polished and refined experiences relatively quickly without delving into dense, low-level code, all while avoiding the headaches of browser inconsistencies, then sprinkle your next project with some PixiJS magic!

Boost your development and feel free to use your imagination!

Learn

  • Website: Find out more about PixiJS on the official website.
  • Getting started:
    • Check out @kittykatattack's comprehensive tutorial.
    • Also check out @miltoncandelero's PixiJS tutorials aimed toward videogames with recipes, best practices, and TypeScript / npm / webpack setup here
  • Examples: Get stuck right in and play around with PixiJS code and features right here!
  • Docs: Get to know the PixiJS API by checking out the docs.
  • Guide: Supplementary guide to the API documentation here.
  • Wiki: Other misc. tutorials and resources are on the Wiki.

Community

  • Forums: Check out the forum and Stackoverflow -- both friendly places to ask your PixiJS questions.
  • Inspiration: Check out the gallery to see some of the amazing things people have created!
  • Chat: You can join us on Discord to chat about PixiJS.

Setup

It's easy to get started with PixiJS! Simply download a prebuilt build!

Alternatively, PixiJS can be installed with npm or simply using a content delivery network (CDN) URL to embed PixiJS directly on your HTML page.

Note: After v4.5.0, support for the Bower package manager has been dropped. Please see the release notes for more information.

NPM Install

npm install pixi.js

There is no default export. The correct way to import PixiJS is:

import * as PIXI from 'pixi.js';

CDN Install

Via jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pixi.min.js"></script>

Or via unpkg:

<script src="https://unpkg.com/[email protected]/dist/pixi.min.js"></script>

Demos

Thanks to @photonstorm for providing those last 2 examples and allowing us to share the source code :)

Contribute

Want to be part of the PixiJS project? Great! All are welcome! We will get there quicker together :) Whether you find a bug, have a great feature request, or you fancy owning a task from the road map above, feel free to get in touch.

Make sure to read the Contributing Guide before submitting changes.

Current features

  • WebGL renderer (with automatic smart batching, allowing for REALLY fast performance)
  • Canvas renderer (Fastest in town!)
  • Full scene graph
  • Super easy to use API (similar to the flash display list API)
  • Support for texture atlases
  • Asset loader / sprite sheet loader
  • Auto-detect which renderer should be used
  • Full Mouse and Multi-touch Interaction
  • Text
  • BitmapFont text
  • Multiline Text
  • Render Texture
  • Primitive Drawing
  • Masking
  • Filters
  • User Plugins

Basic Usage Example

import { Application, Sprite, Assets } from 'pixi.js';

// The application will create a renderer using WebGL, if possible,
// with a fallback to a canvas render. It will also setup the ticker
// and the root stage PIXI.Container
const app = new Application();

// The application will create a canvas element for you that you
// can then insert into the DOM
document.body.appendChild(app.view);

// load the texture we need
const texture = await Assets.load('bunny.png');

// This creates a texture from a 'bunny.png' image
const bunny = new Sprite(texture);

// Setup the position of the bunny
bunny.x = app.renderer.width / 2;
bunny.y = app.renderer.height / 2;

// Rotate around the center
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;

// Add the bunny to the scene we are building
app.stage.addChild(bunny);

// Listen for frame updates
app.ticker.add(() => {
    // each frame we spin the bunny around a bit
    bunny.rotation += 0.01;
});

How to build

Note that for most users you don't need to build this project. If all you want is to use PixiJS, then just download one of our prebuilt releases. The only time you should need to build PixiJS is if you are developing it.

If you don't already have Node.js and NPM, go install them. Then, in the folder where you have cloned the repository, install the build dependencies using npm:

npm install

Then, to build the source, run:

npm run build

How to generate the documentation

The docs can be generated using npm:

npm run docs

The documentation uses webdoc in combination with this template: pixi-webdoc-template. The configuration file can be found at webdoc.conf.json

License

This content is released under the (http://opensource.org/licenses/MIT) MIT License.

More Repositories

1

pixi-react

Write PIXI apps using React declarative style
JavaScript
2,147
star
2

filters

Collection of community-authored custom display filters for PixiJS
TypeScript
886
star
3

particle-emitter

A particle system for PixiJS
TypeScript
777
star
4

spine

Pixi.js plugin that enables Spine support.
TypeScript
537
star
5

examples

Rendering examples using PixiJS and related plugins
JavaScript
469
star
6

sound

WebAudio API playback library, with filters. Modern audio playback for modern browsers.
TypeScript
376
star
7

pixi-ui

Provide a definitive user experience in your PixiJS application without any frontend library!
JavaScript
299
star
8

tilemap

Rectangular tilemap implementation for PixiJS
TypeScript
273
star
9

pixi-typescript

Typescript definitions for Pixi.js
TypeScript
238
star
10

layers

Separate the z-hierarchy of your scene tree from its canonical structure.
TypeScript
220
star
11

animate

PixiJS runtime library for content from Adobe Animate CC
JavaScript
198
star
12

lights

Adds dynamic lighting via deferred shading to PixiJS
TypeScript
191
star
13

open-games

TypeScript
190
star
14

pixi-projection

TypeScript
184
star
15

pixi-haxe

Externs of Pixi.js for Haxe
Haxe
179
star
16

graphics-smooth

Drop-in replacement for Graphics but with anti-aliasing
TypeScript
151
star
17

ui

Commonly used UI components for PixiJS
TypeScript
149
star
18

animate-extension

Custom Platform Plugin for Adobe Animate CC (Formerly Adobe Flash CC) - to export animation for the PixiJS renderer
C++
124
star
19

pixi-heaven

PIXI.js advanced color modes, sprites, meshes
TypeScript
115
star
20

pixi-compressed-textures

Compressed textures and retina support for pixijs. Loader can choose textures depends on platform and rendering mode.
TypeScript
92
star
21

pixi-native

A native version of pixi
Kotlin
85
star
22

pixi-gl-core

A set of tidy little pixi objects that make working with WebGL simpler
JavaScript
83
star
23

assetpack

TypeScript
77
star
24

pixi-extra-filters

[deprecated] Please see https://github.com/pixijs/pixi-filters
JavaScript
66
star
25

pixi-particles-editor

PIXI-based particle editor
JavaScript
65
star
26

picture

A plugin that includes a sprite renderer that reduces border artifacts and 3 blend mode implementations for WebGL
TypeScript
61
star
27

layout

Library for arranging/resizing pixiJS rendered elements basing on css like configs
TypeScript
53
star
28

html-text

Multi-Style Text Rendering Plugin for PixiJS
TypeScript
38
star
29

gif

Plugin to support playback of animated GIF images in PixiJS.
TypeScript
35
star
30

pixi-jsdoc-template

PixiJS Flavored JSDoc Template
JavaScript
30
star
31

extension-boilerplate

Pixi.js example renderer plugin. Clamps textures to reduce border artifacts.
TypeScript
30
star
32

pixijs.com

JavaScript
30
star
33

pixi-text-style

PIXI.TextStyle Generator
JavaScript
30
star
34

floss

Unit-testing for those hard to reach places
TypeScript
28
star
35

storybook

TypeScript
27
star
36

node

Run PixiJS but in Node.js environments, no browser required!
TypeScript
25
star
37

bunny-mark

Simulation for performance testing PIXI releases
JavaScript
20
star
38

devtools

TypeScript
18
star
39

batch

PixiJS batch rendering plugin library
TypeScript
17
star
40

pixify

Browserify bundle process for PIXI libraries
JavaScript
16
star
41

guides

PixiJS User Guides
SCSS
12
star
42

customize

Customize the list of packages to use for PixiJS v5
TypeScript
11
star
43

animate-examples

Document Examples for testing PixiAnimate publishing
10
star
44

docs

API Documentation container
HTML
9
star
45

examples-v4

Rendering examples using PixiJS v4 and related plugins
JavaScript
9
star
46

spine-v8

TypeScript
9
star
47

extension-scripts

Build-time scripts for setting up extensions
JavaScript
6
star
48

pixi-closure-compiler

closure compiler externs for pixijs
JavaScript
6
star
49

eslint-config

ESLint config for pixi.js plugin/integration libraries
JavaScript
5
star
50

webdoc-template

PixiJS template ported to webdoc
TypeScript
4
star
51

generator-pixi-plugin

A Yeoman generator for creating pixi.js plugins.
JavaScript
4
star
52

bundler

Bundle all release into a single package
JavaScript
3
star
53

pixi-animate-tests-tool

Used to generate unit tests solutions for PixiAnimate
JavaScript
3
star
54

legacy.pixijs.com

SCSS
3
star
55

examples-v5

Rendering examples using PixiJS and related plugins
JavaScript
2
star
56

webworker-plugins

TypeScript
1
star
57

examples-v7

JavaScript
1
star