charlie_says Posted July 10, 2019 Share Posted July 10, 2019 I was just trying some experiments with PIXI Projection, but am not able to get it working... I think it could be to do with the imports, I know I had to do something a little different than I expected with PIXI.Sound Can anyone give me any pointers? (trying this as an import: import * as Projection from 'pixi-projection' gives this error: TypeError: PIXI.BatchShaderGenerator is not a constructor ) Thanks! ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 10, 2019 Share Posted July 10, 2019 you need latest development version of pixi, pixijs.download/dev/pixi.js . You cant get it from npm, before BatchShaderGenerator will appear in 5.1.0 release soon charlie_says 1 Quote Link to comment Share on other sites More sharing options...
charlie_says Posted July 10, 2019 Author Share Posted July 10, 2019 Ahhh ok thanks! Quote Link to comment Share on other sites More sharing options...
charlie_says Posted July 22, 2019 Author Share Posted July 22, 2019 Hi @ivan.popelyshev, apologies for resurrecting this post. I noticed that npm had been updated and thought I'd get back on this... but, I'm still not having any luck at getting it working. If I try import {PIXI_projection} from 'pixi-projection'; and try this: console.log(PIXI_projection) // returns undefined I get nothing, similarly any reference to Sprite2D etc. just generates an error. I can see the code is there in the node modules, so it must be a referencing error... (Also, as a further sanity check, is PIXI.projection compatible with pixi.js-legacy?) Quote Link to comment Share on other sites More sharing options...
charlie_says Posted July 22, 2019 Author Share Posted July 22, 2019 Apologies for answering my own question - but just in case anyone comes across this issue. You do still need to import the pixi projection module - but you don't use it directly. I import like this: import * as PIXI from 'pixi.js'; import unused_pixi_projection from 'pixi-projection'; and then just use as per the examples this.sprt =new PIXI.projection.Sprite2d(PIXI.Texture.from('playBtn')); If there is a better/proper way to do this, I'd be happy to hear it! ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 22, 2019 Share Posted July 22, 2019 ok, gonna put it in readme later charlie_says 1 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.