Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@drecom/scene-graph-mediator-rt

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@drecom/scene-graph-mediator-rt

This module converts both scene graph schema and runtime object each other. Each of converters should know runtime object schema, this module provides [pixi.js](https://github.com/pixijs/pixi.js) importer/exporter by default.

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

scene-graph-mediator-rt

This module converts both scene graph schema and runtime object each other. Each of converters should know runtime object schema, this module provides pixi.js importer/exporter by default.

The schema definition of scene graph is based on @drecom/scene-graph-schema .

Usage

For most simple example;

const importer = new SceneGraph.Importers.Pixi();
importer.import(scenegraphJson, (root) => stage.addChild(root));

Building custom import pipeline;

const importer = new SceneGraph.Importers.Pixi();

// create asset list to download
const assets = importer.createAssetMap(scenegraphJson);

// load if any asset is required
if (assets.size > 0) {
  assets.forEach((asset) => PIXI.loader.add(asset));
  PIXI.loader.load(() => importer.restoreScene(app.stage, schema));
} else {
  importer.restoreScene(app.stage, schema);
}

See example directory for working example.

Remarks

To shrink runtime code volume, importer/exporter for each runtime may separated from this repository in the future.

FAQs

Package last updated on 19 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc