npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

phaser4-plugin-debug-draw

v1.0.0

Published

TypeScript debug draw plugin for Phaser 3.53+ and Phaser 4

Readme

phaser4-plugin-debug-draw

TypeScript debug draw plugin for Phaser 3.53+ and Phaser 4

Modern fork of phaser-plugin-debug-draw with full TypeScript support, modern tooling, and compatibility with both Phaser 3 and Phaser 4.

Features

  • Dual Phaser Support - Works with Phaser 3.53.0+ and Phaser 4.0.0+
  • Full TypeScript - Complete type safety with proper type definitions
  • Tiny Bundle - ~9KB minified

What it displays

  • Game object position, origin, bounds, and rotation
  • Interactive objects (input-enabled/disabled)
  • Bitmap masks
  • Input pointers (mouse/touch)
  • Camera bounds, deadzone, and follow target
  • Lights (Light2D system)
  • Layers (recursively processes children)

Installation

npm install phaser4-plugin-debug-draw

Usage

Register the plugin

import Phaser from 'phaser';
import DebugDrawPlugin from 'phaser4-plugin-debug-draw';

const config = {
  // ... your game config
  plugins: {
    scene: [
      {
        key: 'DebugDrawPlugin',
        plugin: DebugDrawPlugin,
        mapping: 'debugDraw'
      }
    ]
  }
};

const game = new Phaser.Game(config);

Use in your scene

class MyScene extends Phaser.Scene {
  create() {
    // The plugin is automatically available as this.debugDraw

    // Customize colors (optional)
    this.debugDraw.color = 0x00ff00;
    this.debugDraw.inputColor = 0xff0000;

    // Toggle visibility
    this.debugDraw.toggle();
  }
}

Configuration

All properties are optional and can be set at runtime:

interface DebugDrawConfig {
  alpha?: number;                    // Default: 1
  cameraBoundsColor?: number;        // Default: 0xff00c3 (fuchsia)
  cameraDeadzoneColor?: number;      // Default: 0xeb7700 (orange)
  cameraFollowColor?: number;        // Default: 0xeb7700 (orange)
  color?: number;                    // Default: 0x00d9f7 (aqua)
  inputColor?: number;               // Default: 0xebcf00 (yellow)
  inputDisabledColor?: number;       // Default: 0x777777 (silver)
  lightColor?: number;               // Default: 0x8d00ff (purple)
  lineWidth?: number;                // Default: 1
  maskColor?: number;                // Default: 0xeb0012 (red)
  pointerColor?: number;             // Default: 0xebcf00 (yellow)
  pointerDownColor?: number;         // Default: 0x00d942 (green)
  pointerInactiveColor?: number;     // Default: 0x777777 (silver)
  showInactivePointers?: boolean;    // Default: false
  showInput?: boolean;               // Default: true
  showLights?: boolean;              // Default: true
  showPointers?: boolean;            // Default: true
  showRotation?: boolean;            // Default: true
}

API

Methods

  • toggle() - Show/hide the debug graphics

Known Limitations

  • Does NOT show Game Objects in Containers
  • Does NOT show Blitter Bobs
  • Does NOT show Particle Emitters

Differences from Original

This fork includes:

  • TypeScript - Full type safety with .d.ts files
  • Phaser 4 support - Tested with both v3 and v4
  • Smaller bundle - ~15% smaller than original

Development

# Install dependencies
npm install

# Build
npm run build

# Type check
npm run typecheck

# Lint & format
npm run lint
npm run format

Credits

Original plugin by samme

License

ISC