-
-
Notifications
You must be signed in to change notification settings - Fork 891
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: Backdrop (static backgrounds) component for CameraComponent #2787
Conversation
@spydon, just a thought, what if let viewfinder + viewport both render on top of the world and use a separate parent for the background? Something like a world background component? Just thinking in terms of a real-life camera, where UI elements of viewfinder are always displayed on top of the image that is being captured. |
Yeah, that might make more sense. Do you think the viewfinder should be affected by the transformations or not then? |
Making it behave similar to viewport should be fine I think. |
@ufrshubham what do you think about this solution? :) |
Looks perfect! (until someone says otherwise 😉) |
Description
This PR adds a backdrop component to the
CameraComponent
which renders behind the world.With this change the rendering order looks like this:
In the following example you can see a
![image](https://private-user-images.githubusercontent.com/744771/272239911-a0b2fe0e-bff3-4d1d-a2d1-ddd3199bbdab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNTkzMDIsIm5iZiI6MTcyMzA1OTAwMiwicGF0aCI6Ii83NDQ3NzEvMjcyMjM5OTExLWEwYjJmZTBlLWJmZjMtNGQxZC1hMmQxLWRkZDMxOTliYmRhYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwN1QxOTMwMDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zNjM2NGM5NzM0OWU5Y2RmZjliNmE2NjMxYjE0ZDVmZWIyZmQ1YzRjMTJhNDc0OTQ2Y2NlMWFmMzk0YmIyNDM1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Y_wMZ5oX-nKS8Vm_V3rAq-wAMhju1VeBjtGGiiNWcu8)
ParallaxComponent
attached to the backdrop, a player and some other components attached to the world, and some texts attached to the viewfinder and viewport:Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
Migration instructions
If you were previously adding your HUDs directly to the viewfinder, add them to the viewport instead.
Related Issues