Giter VIP home page Giter VIP logo

Comments (5)

ivanpopelyshev avatar ivanpopelyshev commented on May 18, 2024 1

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.

ivanpopelyshev avatar ivanpopelyshev commented on May 18, 2024

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.

wizcas avatar wizcas commented on May 18, 2024

@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:

image

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.

ivanpopelyshev avatar ivanpopelyshev commented on May 18, 2024

It is ok to use simple algorithms and move to hard ones when the time comes.

from layers.

wizcas avatar wizcas commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.