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

zimporter-pixi

v1.0.85

Published

A TypeScript library for importing and managing zStudio scenes in PixiJS applications.

Readme

zImporter

The zImporter is a TypeScript package designed to import and manage graphical hierarchies created in zStudio. This package allows seamless integration of assets and scenes built in zStudio into your JavaScript or TypeScript-based projects, particularly those using PixiJS.

Features

  • Import and manage scenes and graphical hierarchies from zStudio

  • Works with PixiJS to display and interact with imported assets

  • Provides a flexible and easy-to-use API for handling assets and scenes.

  • Download zStudios to get started: https://zstudiosltd.com/

Installation

To install the zImporter package from the npm registry:

npm install [email protected]

Or to always get the latest version:

npm install zimporter-pixi@latest

Note: Your tsconfig.json should include:

"module": "ESNext",
"moduleResolution": "bundler"

Building

npm run package

Usage

Importing zImporter into Your Project

You can find an example project here: https://github.com/yonnyzohar/zImporter_PIXI_Example

Basic import:

import { ZTimeline } from 'zimporter-pixi';

Example: Creating a New PixiJS Application

import * as PIXI from 'pixi.js';
import { Game } from './Game';
import { ZSceneStack, ZUpdatables } from 'zimporter-pixi';

const app = new PIXI.Application({
  backgroundColor: 0x000000,
  resolution: window.devicePixelRatio || 1,
  autoDensity: true,
  antialias: true,
});

function resizeCanvas() {
  app.renderer.resize(window.innerWidth, window.innerHeight);
  ZSceneStack.resize(window.innerWidth, window.innerHeight);
}

window.addEventListener('resize', resizeCanvas);

const game = new Game(app.stage, resizeCanvas);
document.body.appendChild(app.view as any);
ZUpdatables.init(24);

let lastTime = performance.now();
let frameCount = 0;

app.ticker.add(() => {
  frameCount++;
  const now = performance.now();
  const delta = now - lastTime;

  if (delta >= 1000) {
    frameCount = 0;
    lastTime = now;
  }

  const deltaMS = PIXI.Ticker.shared.deltaMS / 1000;
  game.update(deltaMS);
  ZUpdatables.update();
});

This sets up a Pixi renderer and integrates zImporter’s update system.

Example: Loading and Displaying a Scene from zStudio

import * as PIXI from 'pixi.js';
import { ZScene, ZSceneStack, ZTimeline } from 'zimporter-pixi';

let scene = new ZScene();
scene.load('./assets/robo/', () => {
  ZSceneStack.push(scene);
  const mc = ZSceneStack.spawn('RobotWalker') as ZTimeline;
  mc.play();
  stage.addChild(mc);
  mc.x = 100;
  mc.y = 200;
});

Example: Loading a Stage Created in zStudio

import * as PIXI from 'pixi.js';
import { ZScene, ZSceneStack } from 'zimporter-pixi';

constructor(stage: PIXI.Container) {
  this.stage = stage;
  const loadPath = (window as any).loadPath;
  const scene = new ZScene('testScene');
  scene.load(loadPath, () => {
    ZSceneStack.push(scene);
    scene.loadStage(this.stage);
  });
}

Each ZScene has a stage associated with it. This preserves the position and orientation logic defined in zStudio. Always add the scene stage to the root container.

API

The package exposes several classes and methods for interacting with imported assets:

ZScene

  • Container for your entire scene.
  • Handles screen resizing.
  • Allows spawning of assets or loading full stages.

ZContainer

  • Core class for all visual elements.

  • Extends PIXI.Container and adds:

    • Anchoring support
    • Orientation data from zStudio
  • Set .resizeable = false to disable responsive behavior.

Working with Text

In ZStudio, texts are always wrapper in a container, and are called "label" by default. If you know a specific container holds a text fields, you can acces it via: getTextField():PIXI.Text | null You can also set a string on the text via the container using: setText(text:string):void

Transform Properties and Orientation

x, y, scale, width, and height should always be set via ZContainer's methods (e.g. setX, setY, setScale) rather than assigned directly on the PIXI properties. This ensures that changes are stored against the active orientation (portrait or landscape) and survive any resize/reorientation event.

visibility, alpha, and rotation, however, apply to both orientations and can be set directly:

mc.visible = false;   // applies in both portrait and landscape
mc.alpha = 0.5;       // applies in both orientations
mc.rotation = 0.3;    // applies in both orientations

mc.setX(100);         // stored per-orientation — use this instead of mc.x = 100
mc.setY(200);         // stored per-orientation
mc.setScaleX(1.5);    // stored per-orientation

Working with Spine

Spine objects loaded through zStudio are wrapped in a ZContainer. To access the underlying Spine instance use getSpine():

import { ZContainer } from 'zimporter-pixi';

const spineContainer = ZSceneStack.spawn('MySpineAsset') as ZContainer;
stage.addChild(spineContainer);

const spineObj = spineContainer.getSpine() as PIXISpine3.Spine | PIXISpine4.Spine | undefined; // Spine 3.8 | Spine 4.0 | undefined

if (spineObj) {
  spineObj.state.setAnimation(0, 'idle', true);
  spineObj.state.addAnimation(0, 'walk', true, 0);
}

Once you have the Spine reference you can interact with it exactly as you would with any regular pixi-spine object — set animations, attach listeners, adjust skin, etc.

ZButton

  • Extends ZContainer.

  • Has .enable() / .disable() methods.

  • Supports child containers with special names:

    • upState, downState, overState, disabledState, labelContainer

When these are defined in zStudio, the button works automatically.

ZTimeline

  • Extends ZContainer.

  • Manages frame-based timeline animations.

  • API includes:

    • .play(), .stop()
    • .gotoAndPlay(frameNum), .gotoAndStop(frameNum)
    • .addStateEndEventListener(cb), .removeStateEndEventListener(cb)

ZState

  • Extends ZContainer.
  • Only one child is visible at a time.
  • Use .setState(name: string) to switch visible content.
  • Can contain nested ZTimeline objects.

Contributing

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a feature branch.
  3. Submit a pull request.

Please follow the existing code style and add tests where relevant.

License

This project is licensed under the MIT License. See the LICENSE file for details.