Closed wizcas closed 5 years ago
Its because i didnt update it this plugin for v5 yet.
Why do you need pixi-layers, whats your case? I can make it this week instead of next if you explain me that your project is awesome enough, or i can tell you how to use easier solutions.
@ivanpopelyshev Thanks for you super fast reply! Sorry I didn't noticed I was using Pixi 5... Always thought I was on 4 ;)
I'm making a stage like this:
Currently the sprites are added in a bottom-up order, so the upper ones are painted after the lower ones. I need to control their painting order by sprites' y-pos, making lower ones on top. Looks like pixi-layers fits right into it.
well, actually v5 has zIndex field. If all of your sprites are in the same container, you can just assign element.zIndex = element.pos.y
, maybe with different sign.
layers are for more extreme cases: to allow things to be rendered not in parent but somewhere else. Character has sprite, shadow, healthbar - to render them in correct order you have to move them into different containers and its bad. Layers allow you to specify where do you want to render them, but leave them with their logic parent :)
Also, layers allows some renderTexture hacks in case you dont want to manage fullscreen render textures yourself.
It is ok to use simple algorithms and move to hard ones when the time comes.
I'll check out the zIndex field, thanks!
Actually I do have the needs for complex layered rendering like shadows and overlay FXs. There will also be overlay UI, which is attached to player, that needs to be rendered on the topmost layer.
So I'm still looking forward to the new release that supports Pixi v5 and hopefully everything goes well😉
It seems that the error is caused by different function signatures. The paramter
renderer
of functionrenderWebGL
in classLayer
is of typePIXI.WebGLRenderer
, whereas it'sPIXI.Renderer
inContainer
.Which one is correct? And how can I make a quick fix for this temperorily?
Here's the compiling error: