The objective is to get symbols scrolling on the sides to maintain size and position, ignoring Camera2D and Light2D. Failed with CanvasLayer and SubViewport. Feels like I'm missing something obvious 🤔
The objective is to get symbols scrolling on the sides to maintain size and position, ignoring Camera2D and Light2D. Failed with CanvasLayer and SubViewport. Feels like I'm missing something obvious 🤔
CanvasLayer should work. At least it did for me. Just make sure that under "Layer" you put it on a layer above 0 (that's where your camera and all your regular nodes live, if you don't explicitly put them into a CanvasLayer of their own).
Pine Hey thanks for the reply!
Using the CanvasLayer solves the light issue, but it's children are still affected by the Camera2D zoom. Is there any way to prevent that?
Hern Yes. Make sure the camera is not in the UI CanvasLayer.
Node2D
- AnotherNode2D for everything that's effected by your zoom
- Camera2D
- CanvasLayer for UI
- all your UI nodes
There's an explanation here:
https://docs.godotengine.org/en/stable/tutorials/2d/canvas_layers.html
I have this setup, but the Camera2D is still affecting my Sprite2Ds. I tried a TextureRect but still got the same results. This is incredibly frustrating 😅
EDIT: I just noticed I had "Follow Viewport" on! Turning it off made the sprites disappear, but the docs say the following so I'm hopeful:
"If enabled, the CanvasLayer will use the viewport's transform, so it will move when camera moves instead of being anchored in a fixed position on the screen."
SOLUTION: Scaled the CanvasLayer down to 0.1 and set the Offset to half my target resolution (full-HD)! Thank you for pointing me in the right direction Pine!
© 2022 - 2024 — McMap. All rights reserved.