dazzafact Posted November 27, 2020 Share Posted November 27, 2020 Hello, how can i convert a PixiJs Sprite to add it to my Canvas stage (fabricJs)? iam getting this error: fabric.min.js:8168 Uncaught TypeError: obj._set is not a function slideBildMesh = PIXI.Sprite.from($jsonDefault.img); $app = new fabric.Canvas('itemcontent1', { backgroundColor: 'lightgrey', width: divWidth, height: divHeight }); $app.add(slideBildMesh); //<--- error Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 27, 2020 Share Posted November 27, 2020 (edited) well, you learn Fabric from scratch, you learn PixiJS, then you understand whats different in the stage tree, make special adapters, ... Edited November 27, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 28, 2020 Share Posted November 28, 2020 (edited) You can try to share context2d, you have to use pixi.js-legacy package (aka pixi-legacy.js) https://www.npmjs.com/package/pixi.js-legacy , create CanvasRenderer (not just Renderer), and make sure that Fabric nor PixiJS changes state of context2d between them. In that case, only knowledge of CanvasRenderingContext2d is required ) Edited November 28, 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.