Jump to content

forceCanvas property of PIXI.Application having no affect.


Twelve47Kevin
 Share

Recommended Posts

  • 1 year later...

Hello Ivan,

I was able to make it work by assigning CanvasRenderer as type to temp variable - then also app renderer has changed but now the error occurs: Uncaught TypeError: displayObject.renderCanvas is not a function

Edited by MichalGo
Link to comment
Share on other sites

If you work with individual pixi packages you have to be aware about bundles

https://github.com/pixijs/pixi.js/blob/dev/bundles/pixi.js/src/index.js

https://github.com/pixijs/pixi.js/blob/dev/bundles/pixi.js-legacy/src/index.js

You can use only "@pixi/canvas-renderer" if you are ready to write all display scene related functions yourself.

The big problem with ES6 imports/exports is that this approach doesnt care about initialization of dependencies. PixiJS is not a framework, it does not have dependency injection but it uses a few internal dependencies that make it whole. That makes work of library and plugin maintainers hell.

1. People use npm, React and webpack

2. People are convinced that is our problem to deal with the fact that they use webpack.

3. People require extra documentation from us to make their apps work with pixi through treeshaking bundler

And you know what? We are ready to do it, because we love our community! Just not right now, maybe in a year or a few, and only if there will be more people to help us. Its a work in progress at the moment.

Here's a thread about it: 

 

Alternatively: Throw it all out, use vanillaJS and single file we supply in release: https://github.com/pixijs/pixi.js/releases/tag/v5.2.1

Link to comment
Share on other sites

Regarding your case - you are doing something wrong. just include "pixi.js-legacy" somewhere , and it should register all renderers in autodetect. Unless you somehow stumbled across a bug with two pixies alive (pixi.js 5.2.0, pixi-legacy 5.2.1 or something like that). In that case, erase node_modules and package.lock and reinstall it.

Edited by ivan.popelyshev
Link to comment
Share on other sites

Hello Ivan. I installed pixi.js-legacy and used it while creating the app (PIXI.Application) and set forceCanvas to true and it works now thanks. I have one more question. I use only PIXI.Application from pixi.js-legacy and the rest from pixi.js - is that good or should be changed?

Link to comment
Share on other sites

  • 2 months later...

@ivan.popelyshev  Hi, Ivan. I did the things as MichalGo said: only used pixi.js-legacy to create the app(PIXI.Application) and set forceCanvas to true. But then I had an error: TypeError: Cannot redefine property: ticker. and the version of both of pixi.js and pixi.js-legacy are 5.2.4. Also, when I just include "pixi.js-legacy" somewhere, it reminds me the same error. Are there something I miss to use the pixi.js-legacy? I appreciated any advices, and thanks for all the awesome work of pixi.js.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...