jasonsturges Posted November 7, 2019 Share Posted November 7, 2019 Are there some examples of extending PIXI.utils namespace? Taking a look at Pixi's debugging and editor tools, the Free Transform Tool appears to extend PIXI.utils - cool library, looks pretty alpha without npm or webpack. Just references PIXI in a global scope and attempts to prototype utils. If I want to extend Pixi through utilities, or maybe just provide webpack module libraries through npm, any recommendations such as good example projects to follow? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 7, 2019 Share Posted November 7, 2019 Extending such way its supported with webpack is difficult. Most of my plugins work like that: import * as PIXI from "pixi.js"; global.PIXI = PIXI; require("pixi-spine"); then pixi-spine takes global PIXI and adds "PIXI.spine" inside, and also a few methods for existing classes in pixi. You can use the same approach - make a library that works with global pixi. In future we'll provide a way that is free of problems like "there are two versions of pixi in node_modules now", we have some problems with peer dependencies. Right now dont focus on webpack and just do this thing. jasonsturges 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 7, 2019 Share Posted November 7, 2019 Example of what can go wrong with pixijs + webpack + plugins: https://github.com/pixijs/pixi.js/issues/6208 jasonsturges 1 Quote Link to comment Share on other sites More sharing options...
jasonsturges Posted November 8, 2019 Author Share Posted November 8, 2019 Interesting - my projects embed Pixi within React lately, but worked well in that ecosystem. Also interested in moving more to TypeScript... been slow to adopt, but I like the language features. 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.