Maps a
Windowaccurately into 2D world space, with full control both ways.
A Camera2D inheriting node that allows for an attached Window node to have it's screen position and size corelate exactly to this node's global_position and camera size.
This supports both embedded and native windows, and allows for the screen offsets to be relative to the virtual screen space or the SceneTree.root.
This also ensures that the positioning and resizing of the window works both ways, allowing for full use of the native OS's window handles.
Due to heavy implementation changes introduced in Godot-Spyglass v2, Godot-Spyglass v2 is not backward compatible with Godot-Spyglass v1. This also means that compatibility with Godot v4.5 is no longer supported.
- Since the
frame_windowshares the sameWorld2Das this node, additional efforts must be taken to ensure child nodes of theframe_windowdon't appear in theSceneTree.rootor other viewports, such as usingCanvasLayernodes or different rendering layers to do this instead. - As this inherits from (and is a type of)
Camera2D, at least one other (properly enabled)Camera2Dshould exist in the tree to ensure that theSceneTree.rootWindowdoes not also display the view from this as a camera. - Due to some native OS's window snapping routines, using a
anchor_modebesidesANCHOR_MODE_FIXED_TOP_LEFTmay result in jittering and disjoining the position from global space when resizing the window. - Due to the rendering order of
Windownodes, a spyglass with a native window, when moved via the window itself (as opposed to moving this spyglass in world-space), may show the view from its new world position only after the window itself is moved. This will likely be seen as a jittering effect when the window is moved at a moderate speed. To add or remove a manual delay for window-to-world or world-to-window updates, seedefer_window_updates. - Disabling
ignore_rotationfor this node will likely cause visual issues.