Skip to content

Commit

Permalink
Fixes Node not starting (pixijs#8497)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Jul 15, 2022
1 parent ffa04c3 commit 011feab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bundles/pixi.js-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ To build from source you will need to make sure you have the following dependenc
```js
import { Application, Sprite, Assets } from '@pixi/node';
import path from 'path';
import { writeFileSync } from 'fs';

// This package requires the new asset loader to be used.
// Initialize the new assets loader
Expand Down Expand Up @@ -68,9 +69,9 @@ app.ticker.add(() => {
});

// extract and save the stage
app.renderer.render(stage);
app.renderer.render(app.stage);
const base64Image = app.renderer.plugins.extract
.canvas(stage)
.canvas(app.stage)
.toDataURL('image/png');

const base64Data = base64Image.replace(/^data:image\/png;base64,/, '');
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ const extensions = {
{
list.push(extension.ref);
// TODO: remove me later, only added for @pixi/loaders
extension.ref.add?.();
if (type === ExtensionType.Loader)
{
extension.ref.add?.();
}
},
(extension) =>
{
Expand Down

0 comments on commit 011feab

Please sign in to comment.