So details regarding the project:
What I'm trying to achieve is seamless 2D world-wrapping. You scroll to the far right edge of the screen and you end up back on the far left side of the map, but there's no hard edge or boundary you run into. As you approach the right edge, you need to be able to see what lies back on the far left side. Teleporting objects back and forth which cross the boundary is easy, and I can achieve the illusion of the world-wrapping rather effortlessly by moving around some viewports, cameras, etc. But the problem is that objects get clipped by the background at the world's edge. So if an object is "hanging" over the left or right edge, then when you approach one side of the map the object's sprite is clipped by the background of the world since viewports don't respect the Z-Levels of the objects they're viewing.
What I need to do is be able to set up a special camera that doesn't render the background sprite, and only renders other objects in the world, so that the viewport doesn't clip the object sprites with the background sprite.
I came up with 3 solutions, but only one seems viable:
- Separate the background from the foreground objects. - Doable, but hacky and not preferable. Would make switching worlds more tedious than I'd prefer.
- Set up a special camera that ignores the background. - Doesn't seem possible with Camera2D.
- Get the viewports to respect the Z-Levels of the objects they're viewing. - Also doesn't seem possible. Viewports seem to just "screenshot" the world and paste it like an image.