2.5.0 • Published 2 months ago

pixi-shim v2.5.0

Weekly downloads
64
License
MIT
Repository
github
Last release
2 months ago

Purpouse

  1. Designed for node - it makes you run universal javascript code that is designed with pixi.js on node.js environment

  2. It is very lazy - meaning it won't load anything twice and won't attempt to load it if it's not required

  3. It wont even load itself twice - while including multiple instances of pixi.js can cause Cannot redefine property isJson Error

Lazy loading

with lazy polyfill of

  • DOM
  • Window
  • Canvas
  • PIXI
  • other polyfills (requestAnimationFrame, etc.)

Usage

require("pixi-shim");

Usage if your game/app is feature-heavy:

and it still doesn't work, you might need to

$ yarn add pixi.js-legacy

and then do

require("pixi-shim");
require("pixi.js-legacy");

Installation

$ yarn add pixi-shim

DEBUG

environment flag DEBUG enables DEBUG with progress on which polyfill have been loaded

$ DEBUG=pixi-shim node -r pixi-shim yourscript.js

Canvas.toDataURL()

a bit hackish but works, see:

Tests

Total test suites: 2
Passed test suites: 2
Done in 4.35s.
ites: 0

Total tests: 10
Passed tests: 10
Failed tests: 0

Test Suite - /home/pietal/projects/pixi-shim/index.spec.js
passed - GIVEN pixi-shim THEN requiring it doesnt throw error
passed - GIVEN pixi-shim THEN new PIXI.Application doesnt throw error
passed - GIVEN pixi-shim THEN new PIXI.Sprite from base64 image does *not* work
passed - GIVEN pixi-shim THEN toDataURL does *not* yet work
passed - GIVEN pixi-shim THEN normal PIXI gameLoop works

Test Suite - /home/pietal/projects/pixi-shim/pixi.spec.js
passed - GIVEN pixi-shim/pixi THEN requiring it doesnt throw error
passed - GIVEN pixi-shim/pixi THEN new PIXI.Application doesnt throw error
passed - GIVEN pixi-shim/pixi THEN new PIXI.Sprite from base64 image *should* work
passed - GIVEN pixi-shim/pixi THEN toDataURL *should* work with pixi.js
passed - GIVEN pixi-shim/pixi THEN normal PIXI gameLoop works

https://app.circleci.com/pipelines/github/Prozi/pixi-shim

License

MIT (c) 2020-2022 Jacek Pietal

2.5.0

2 months ago

2.4.1

4 months ago

2.4.0

2 years ago

2.3.24

2 years ago

2.3.23

2 years ago

2.3.25

2 years ago

2.3.22

2 years ago

2.3.20

2 years ago

2.3.21

2 years ago

2.3.17

2 years ago

2.3.19

2 years ago

2.3.18

2 years ago

2.3.8

2 years ago

2.3.9

2 years ago

2.3.16

2 years ago

2.3.13

2 years ago

2.3.12

2 years ago

2.3.15

2 years ago

2.3.14

2 years ago

2.3.11

2 years ago

2.3.10

2 years ago

2.3.7

3 years ago

2.3.6

3 years ago

2.3.4

3 years ago

2.3.3

3 years ago

2.3.5

3 years ago

2.3.2

3 years ago

2.3.0

3 years ago

2.2.1

3 years ago

2.3.1

3 years ago

2.2.0

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.14

5 years ago

1.3.13

5 years ago

1.3.12

5 years ago

1.3.11

5 years ago

1.3.10

5 years ago

1.3.9

5 years ago

1.3.8

6 years ago

1.3.7

6 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago