Comments (5)
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.
from layers.
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.
from layers.
@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.
from layers.
It is ok to use simple algorithms and move to hard ones when the time comes.
from layers.
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๐
from layers.
Related Issues (20)
- A bit confused about how to use HOT 3
- PIXI Events propagation bug with zOrder HOT 2
- Z-Index change has no effect HOT 1
- Masking don't work with pixi/layers
- Bug: PIXI Events not respecting zOrder hierarchy of PIXI Layers plugin HOT 2
- Uncaught TypeError: renderer.incDisplayOrder is not a function HOT 6
- updates for pixi v8
- Objects disappear when setting clearing parentGroup/parentLayer
- TS error: Can't assign Layer to Container HOT 4
- Uncaught TypeError: this.applyRenderMixing is not a function HOT 4
- Calling InteractionManager.hitTest throws an exception HOT 3
- Layers cannot be masked ? HOT 9
- I've read through all the documentation / examples and still don't understand how to use this plugin. HOT 13
- how to use webpack pixi-layers HOT 3
- Renderer mixin not applied properly
- How to Set a Clear Colour
- Examples are not working
- After upgrade to v1.0.11, compile to commonjs modules no longer possible in tsConfig HOT 3
- No output with webworkers HOT 1
- support @pixi/events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from layers.