Cran Posted January 2, 2020 Share Posted January 2, 2020 I am new to pixi and I can't seem to find any tutorials of how to install pixi - layers, there are pieces of what i need to do, in the main file the dist folder containing the compressed files, and running npm i pixi-layers, but i don't know how to set up the files so that command will run, i also think i may need an import command in my script, but i don't know the syntax i would need. Sorry this is a really silly question but I can't seem to find a way to set this up, even if there was a video or tutorial that explains this that would be awesome. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 2, 2020 Share Posted January 2, 2020 (edited) Well, it depends on whether you're old JQuery coder or new React one Two ways. 1. You use vanillajs, no imports, no webpacks - just download "distp/pixi-layers.js" add <script src = "pixi-layers.js"></script> after pixi.js in html page. 2. es6 import. Weppack, rollup, parcel - `npm i pixi-layers`, then https://github.com/pixijs/pixi-spine#webpack-and-angular Why not just make it like "react-xxx-plugin" ? Well, try to make a WebGL library that can work both with old vanilla js and imports, and supports TypeScript at the same time. Those who made "imports" in ES6 just didn't care about hardcore stuff. One of downsides of npm packets-based architecture is that it can spawn two instances of PixiJS and they concurrent for texture cache, webgl resources and other stuff. That's why I recommend to actually know have some experience with imports before you use them. Stick to plain JS <script> tag if its possible. Edited January 2, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
Cran Posted January 3, 2020 Author Share Posted January 3, 2020 Thanks! That seems obvious now, but I had no idea how to add that, the first method should work for me, the dist folder has 3 files in it though, i assume those need to stay together in a folder so they can reference each other? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 3, 2020 Share Posted January 3, 2020 (edited) 1. JS file 2. MAP file - source mapping , not needed, you can debug even without it because lib is not obfuscated 3. Typescript declaration, in case you use typescript, copy it to your libs folder if you need it. Edited January 3, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.