The LoseCanvas becomes visible when the Player dies. To ensure it always fits the screen and remains centered, its size is updated every frame to match the window dimensions, and its position is recalculated to be in the center of the window on each frame. This allows it to respond dynamically to any window resizing.
The GameManager handles the instantiation of the LoseCanvas. The LoseCanvas is instantiated as a direct child of the scene, rather than a child of the GameManager itself. This is because the LoseCanvas belongs to a different rendering layer (UI) than the GameManager (default). Due to the layer filtering mechanism in the Node system, which halts rendering of a subtree when layers don't match at the root, this separate instantiation is necessary to ensure the UI is rendered correctly.