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

@gamotions/phaser-runtime-editor

v0.1.0

Published

A Phaser 3/4 scene plugin that injects a runtime visual editor — drag objects, inspect properties, snap to grid, and export layout coordinates as JSON.

Downloads

40

Readme

@gamotions/phaser-runtime-editor

A Phaser 4 scene plugin that injects a runtime visual editor into any game. Press a hotkey to pause the game, drag objects to reposition them, inspect and edit properties, snap to grids, and read back design-space coordinates for your code.

Phaser 4.x MIT License

Features

  • Move, rotate, and scale gizmos — axis-constrained or free transform
  • Inspector panel — edit transform, origin, display properties in real-time
  • Hierarchy panel — scene tree with expand/collapse for Containers, visibility toggle
  • Snapping — grid snap and object-center snap with visual guide lines
  • Hit area visualization — see Rectangle, Circle, and Polygon hit areas on selected objects
  • Design-space coordinates — all values shown in your authored coordinate space, independent of screen size
  • Non-destructive — all changes reset when you exit the editor; use it to measure and copy coordinates

Install

npm install @gamotions/phaser-runtime-editor

Setup

Register the plugin in your Phaser game config:

import { PhaserEditorPlugin } from '@gamotions/phaser-runtime-editor';

const config = {
    // ... your game config
    width: 720,
    height: 1280,
    scale: {
        mode: Phaser.Scale.FIT,
        autoCenter: Phaser.Scale.CENTER_BOTH,
    },
    plugins: {
        scene: [
            {
                key: 'PhaserEditor',
                plugin: PhaserEditorPlugin,
                mapping: 'editor',
                start: true,
                data: {
                    designWidth: 720,   // your design width
                    designHeight: 1280, // your design height
                    hotkey: 'F2',       // key to toggle editor (default: 'F2')
                },
            },
        ],
    },
};

new Phaser.Game(config);

Usage

  1. Run your game
  2. Press F2 (or your configured hotkey) to open the editor
  3. Click objects on the canvas to select them
  4. Use the toolbar to switch tools: Select, Move, Rotate, Scale
  5. Edit properties in the inspector panel on the right
  6. Browse the scene tree in the hierarchy panel on the left
  7. Read design-space coordinates from the coordinate bar or inspector
  8. Press F2 again to close the editor — all objects return to their original state

Plugin options

| Option | Type | Default | Description | |--------|------|---------|-------------| | designWidth | number | 720 | Logical width your game is designed for | | designHeight | number | 1280 | Logical height your game is designed for | | hotkey | string | 'F2' | Keyboard key to toggle the editor (uses KeyboardEvent.key values) |

Snapping

Enable snapping from the toolbar:

  • Grid snap — snaps to a configurable grid size (in design-space units)
  • Object snap — snaps to the center of nearby objects, with magenta guide lines

Dev-only usage

To include the editor only in development builds:

{
    key: 'PhaserEditor',
    plugin: PhaserEditorPlugin,
    mapping: 'editor',
    start: import.meta.env.DEV,  // Vite
    // start: process.env.NODE_ENV !== 'production',  // Webpack
    data: { designWidth: 720, designHeight: 1280 },
}

When start is false, the plugin is registered but never boots, so no editor code runs in production.

How it works

The editor launches a dedicated Phaser Scene (__PhaserEditorScene__) on top of your game. Your game scenes are paused while the editor is open. A CSS grid layout wraps the canvas with HTML panels (hierarchy, inspector, toolbar) while gizmos are drawn via Phaser's Graphics API for pixel-precise alignment.

All coordinates are computed in design-space — the logical coordinate system your game is authored in. This means the values you read in the editor work at any screen size, since the editor accounts for Scale.FIT scaling and letterboxing offsets.

When you exit the editor, every object's position, rotation, scale, origin, alpha, and visibility are restored to their pre-editor values.

Compatibility

  • Phaser 4.x (developed and tested against 4.0.0-rc.6+)
  • Phaser 3 is not currently supported — the plugin uses Phaser 4 internals for config reading
  • Works with Scale.FIT and CENTER_BOTH (other scale modes untested)
  • ES module and CommonJS builds included

License

MIT