Giter Club home page Giter Club logo

pixi-inspector's Introduction

PixiJS Devtools

Browser extension to debug games and apps written with PixiJS.

Features

  • Show the scene graph
  • View and edit properties
  • Double-click in the outliner to console.log a node
  • Outline the active node in the viewport.
  • The active node is available in the developer console as $pixi
  • Right-click (or alt click) in the viewport to activate a node

Installation

Install PixiJS Devtools from:

Usage

PixiJS

In your code find where the PIXI.Application instance is created, it looks like this:

import { Application } from "pixi.js";

const app = new Application(...)

Expose that app to the PixiJS Devtools by adding the line:

globalThis.__PIXI_APP__ = app;

or depending on your TypeScript and ESLint configuration:

(globalThis as any).__PIXI_APP__ = app; // eslint-disable-line

Phaser

In your code find where the Phaser.Game instance is created, it looks like this:

import Phaser from "phaser";

const game = Phaser.Game(...)

Expose that game to the PixiJS Devtools by adding the line:

globalThis.__PHASER_GAME__ = game;

Custom setup?

If you don't use a PIXI.Application or Phaser.Game? you can specify the root-node manually with:

globalThis.__PIXI_STAGE__ = yourContainer;

And to enable highlighting and selecting the nodes in the viewport add:

globalThis.__PIXI_RENDERER__ = yourRenderer;

pixi-inspector's People

Contributors

bfanger avatar miltoncandelero avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.