Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add VFXProps.zIndex #80

Merged
merged 2 commits into from
Jul 5, 2024
Merged

feat: add VFXProps.zIndex #80

merged 2 commits into from
Jul 5, 2024

Conversation

fand
Copy link
Owner

@fand fand commented Jul 5, 2024

This PR addes VFXProps.zIndex, which allows users to specify the rendering order of the elements.

VFX-JS renders elements in ascending order by the zIndex.
Elements that have the same zIndex will be rendered by the order they were added.

For example, when we add elements like this:

vfx.add(a, { shader }); 
vfx.add(b, { shader, zIndex: -1 }); 
vfx.add(c, { shader, zIndex: 1 }); 
vfx.add(d, { shader, zIndex: 1 }); 

Then the rendering order will be b -> a -> c -> d.

This PR solves #79 .

Copy link

vercel bot commented Jul 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-vfx-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 5, 2024 11:54pm

@fand fand merged commit 56306c0 into main Jul 5, 2024
3 checks passed
@fand fand deleted the feat/z-index branch July 5, 2024 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant