pixi-projection icon indicating copy to clipboard operation
pixi-projection copied to clipboard

PIXI 6 support

Open sergaks opened this issue 4 years ago • 20 comments

Are there any plans to support PIXI 6?

sergaks avatar Apr 19 '21 18:04 sergaks

currently im moving pixi-spine to v6, its almost ready, projection is next.

As for projection, it should work like that, the old way, with window.PIXI=PIXI , and without typings.

ivanpopelyshev avatar Apr 20 '21 07:04 ivanpopelyshev

@ivanpopelyshev
However, it still cannot be used at present. May I ask if you can provide a demo

image

image

jahnli avatar Apr 26 '21 01:04 jahnli

Same. Writing the same thing and it isn't working. In my case I get:

Attempted import error: 'projection' is not exported from 'pixi.js-legacy' (imported as 'PIXI').

(Error probably triggering on the first line that attempts to use the camera: new PIXI.projection.Camera3d())

PabloNeirotti avatar Jun 24 '21 13:06 PabloNeirotti

use require, not import. Or wait when i convert it at last :)

ivanpopelyshev avatar Jun 24 '21 13:06 ivanpopelyshev

@ivanpopelyshev do you have a plan/estimate when you would be looking into this? I could take a peek at some point now that my pixi-particles v6 port PR has been approved. If you're going to do this soon then there's no point for me to look at it since you'll probably get it done much faster anyways and I'd like to avoid us doing the same work twice.

qtiki avatar Jun 24 '21 14:06 qtiki

this week probably. The problem is that i want to separate it to multiple packages so it will be something like pixi-spine by structure.

ivanpopelyshev avatar Jun 24 '21 14:06 ivanpopelyshev

I tried both! I get the same issue with both, unfortunately.

On Jun 24, 2021, at 4:37 PM, Ivan Popelyshev @.***> wrote:

 this week probably. The problem is that i want to separate it to multiple packages so it will be something like pixi-spine by structure.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

PabloNeirotti avatar Jun 24 '21 15:06 PabloNeirotti

The problem is that i want to separate it to multiple packages so it will be something like pixi-spine by structure.

@ivanpopelyshev I guessed you might have some plans like that. That does make it a bit more complicated so I'll keep my fingers off the plugin for now. 😅

qtiki avatar Jun 24 '21 16:06 qtiki

https://github.com/pixijs/pixijs/pull/7548 got merged, hope new release soon , i need this for projection too

ivanpopelyshev avatar Jun 24 '21 16:06 ivanpopelyshev

Any news on progress?

vkarponen avatar Jul 01 '21 20:07 vkarponen

@vkarponen tomorrow!

ivanpopelyshev avatar Jul 04 '21 00:07 ivanpopelyshev

OK, now we have a problem: current version that projection typings work with [email protected]. There are a few possible problems with that versions number, for example you cant use pixi-spine with it because it does not satisfy the "peer-dependency" condition

ivanpopelyshev avatar Jul 04 '21 16:07 ivanpopelyshev

What's your dependency on pixi spine? Spine can work on 6 or greater, this works on 6.1 or greater, shouldn't be an issue 🤔

miltoncandelero avatar Jul 04 '21 16:07 miltoncandelero

c:\rep\pixi-games\pixi-projection>npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @pixi/[email protected]
npm ERR! node_modules/@pixi/constants
npm ERR!   dev @pixi/constants@"^6.1.0-rc.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @pixi/constants@"^6.0.2" from @pixi-spine/[email protected]
npm ERR! node_modules/@pixi-spine/base
npm ERR!   dev @pixi-spine/base@"^3.0.4" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

ivanpopelyshev avatar Jul 04 '21 16:07 ivanpopelyshev

The main problem is that if i remove spine dep, then someone else can try to use pixi-spine with pixi-projection and it'll be problem for him anyway

ivanpopelyshev avatar Jul 04 '21 16:07 ivanpopelyshev

I don't say remove the dep, I mean write it differently. >=6 would work but when 7 comes out it won't give you an error., Or you can ^6.0.0||^6.1.0

(Syntax might be off, I am from my phone)

miltoncandelero avatar Jul 04 '21 16:07 miltoncandelero

OK, that can wait, i just put as any in many places with a comment that i'll remove in 6.1.0. I hope that doesnt affect user code :)

ivanpopelyshev avatar Jul 04 '21 17:07 ivanpopelyshev

Done, try 0.4.1 in npm

ivanpopelyshev avatar Jul 04 '21 17:07 ivanpopelyshev

@ivanpopelyshev I tried using 0.4.1 in npm and had the following error: game-main.js:83709 Uncaught RangeError: Maximum call stack size exceeded at h.convertTo3d

when using modules. So, for now I modified the function PIXI.Sprite.prototype.convertTo3d which had convertTo3d.call(this); to PIXI.Container.prototype.convertTo3d.call(this);

This solves the issue for me, Is there a better approach which could be updated in the package?

bjindal-ig avatar Aug 02 '21 12:08 bjindal-ig

oh !@#$ OK, 0.4.2 fixed.

https://github.com/pixijs/pixi-projection/commit/24787ea4315063ef8009abaeb0a23765898e94c8

ivanpopelyshev avatar Aug 02 '21 13:08 ivanpopelyshev