pixijs / pixi-haxe

Externs of Pixi.js for Haxe
http://www.pixijs.com
MIT License
180 stars 65 forks source link

pixijs 5 #161

Closed notboring closed 4 years ago

notboring commented 5 years ago

These externs need to be updated for pixijs 5. This issue is for updates and comments.

Some of the required changes for v5 are listed here:

https://github.com/pixijs/pixi.js/wiki/v5-Migration-Guide

notboring commented 5 years ago

work in progress:

https://github.com/notboring/pixi-haxe/commits/pixi5

notboring commented 4 years ago

I need some input on what's still missing or broken on the current pixi 5 externs. Please throw pixi 5 related issues and pull requests at me. Thanks!

markknol commented 4 years ago

Just want to let you know that I did quite some updates on my pixi5 branch lately. I've used it in production (using pixi.js v5.2.1) https://github.com/markknol/pixi-haxe/commits/pixi5 The spine externs are as good as fully up to date now.

I made it haxe 4 only.

notboring commented 4 years ago

Thanks a lot, @markknol. I updated my pixi 5 branch to include all of your changes. The limitation to haxe 4 is fine with me since haxe 4 is mature enough for productive work.

I will merge the pixi 5 branch into the official pixi repository and ofc also create the haxelib release, if nobody else has any suggestions or comments.

bedwardly-down commented 4 years ago

How stable and production ready is this and the rest of the master branch?

markknol commented 4 years ago

My branch is stable. I'm using it for our recent games. The spine externs are also up to date to latest. It does require Haxe 4.

bedwardly-down commented 4 years ago

Thanks for the response, @markknol. 😸

bedwardly-down commented 4 years ago

I'm porting another framework's Pixi-Haxe implementation from v4 to v5 and, so far, it's been a very smooth transition. The code compiles and runs, but I'm getting an Uncaught TypeError: PIXI.Renderer is not a constructor in the console and nothing is rendering. Any ideas here?

ivanpopelyshev commented 4 years ago

Webpack stuff?

bedwardly-down commented 4 years ago

Not that I can tell. It's going straight to the browser and only required changing something like 10 lines of code to compile.

bedwardly-down commented 4 years ago

I'm moving from this:

_renderer = Detector.autoDetectRenderer( { view: _canvas }, isLocal || ( _canvas.getAttribute( "forceCanvas" ) == "true" ) );
_renderer.resize( factory.width, factory.height );

to this:

_renderer = new Renderer( { view: _canvas, width: factory.width, height: factory.height });

Renderer is the new pixi.core.renderers.webgl.Renderer one since the Canvas renderer has been deprecated in v5.

ivanpopelyshev commented 4 years ago

Canvas renderer wasnt deprecated, its just not available in default bundle, how could you write this heresy? Canvas2d is alive and nothing can replace it! :)

bedwardly-down commented 4 years ago

Canvas will rule the world of WebGL still. Bwahahah

bedwardly-down commented 4 years ago

I solved my issue pretty easily. The pixi.min.js file for the framework wasn't the proper version (so I changed the htm file script to link to 5.2.1 release page) and had to load the pixi-sound plugin there. Then, enabling file system resource loading in my browser allowed for the demo to run. :smile_cat:

@notboring and @markknol, great job on updating this to version 5. Super slick porting process from v4 to v5.

VolkovRA commented 4 years ago

Hello! It seems the haxe externs is missing this pixi API? I cannot found:

  1. https://pixijs.download/dev/docs/PIXI.BaseTexture.html#.addToCache
  2. https://pixijs.download/dev/docs/PIXI.utils.html#.skipHello
markknol commented 4 years ago

Do you mean in my pixi5 branch?

VolkovRA commented 4 years ago

I meant version 4.8.4 of master. (haxelib install pixijs) Is this a new api that isn't in version 4?

So, i will try look pixi5 branch, thanks.

VolkovRA commented 4 years ago

Hello again! Now I'm trying use you pixi5 branch, and i have trouble with overriding methods.

I cannot override width/height properties of pixi.core.display.Container. In source TypeScript code its is getter and setter, not simple variable, as in haxe externs.

How i can extend Container with override his params, for my custom Components?

hypersurge commented 4 years ago

@notboring thanks do you have an eta for a v5 haxelib push?

notboring commented 4 years ago

The pixi 5 version has been put live on haxelib. If you posted issues/questions here and your issue hasn't resolved yet, please post a seperate issue for it.