Manages a collection of views for a render surface, handling view creation, removal, ordering, and multi-viewport layouts. Each view combines a camera and viewport to control what portion of the scene is rendered and where it appears on screen.
More...
|
| void | AddView (Rectangle targetRectPx, float zoom=1f, int zOrder=0, RectangleF? worldBoundsPx=null) |
| | Creates and adds a new view with the specified screen rectangle, zoom level, and Z-order. The view is automatically configured with a camera that can be optionally clamped to world bounds.
|
| void | ConfigureSingleFullView (float zoom=1f, int zOrder=0) |
| | Removes all existing views and creates a single full-screen view that occupies the entire render surface adapter.
|
| void | ConfigureVerticalSplit (float leftZoom=1f, float rightZoom=1f) |
| | Removes all existing views and creates a vertical split-screen layout: left and right views sharing the full height of the render surface.
|
| void | ConfigureHorizontalSplit (float topZoom=1f, float bottomZoom=1f) |
| | Removes all existing views and creates a horizontal split-screen layout: top and bottom views sharing the full width of the render surface.
|
| void | ClearViews () |
| | Removes all views from the manager, unsubscribing from their events and marking the scene as needing a full refresh.
|
| IReadOnlyList< View > | GetViewsBelow (View view) |
| | Returns all views that are rendered behind (below) the specified view, based on Z-order. Views with lower Z-order values appear behind.
|
| IReadOnlyList< View > | GetViewsAbove (View view) |
| | Returns all views that are rendered in front of (above) the specified view, based on Z-order. Views with higher Z-order values appear in front.
|
|
| ReadOnlyCollection< View > | Views [get] |
| | Gets a read-only collection of all views currently managed by this view manager. Views are sorted by Z-order, with lower values appearing first (drawn behind).
|
Manages a collection of views for a render surface, handling view creation, removal, ordering, and multi-viewport layouts. Each view combines a camera and viewport to control what portion of the scene is rendered and where it appears on screen.
◆ AddView()
| void Gondwana.Rendering.Views.ViewManager.AddView |
( |
Rectangle | targetRectPx, |
|
|
float | zoom = 1f, |
|
|
int | zOrder = 0, |
|
|
RectangleF? | worldBoundsPx = null ) |
Creates and adds a new view with the specified screen rectangle, zoom level, and Z-order. The view is automatically configured with a camera that can be optionally clamped to world bounds.
- Parameters
-
| targetRectPx | The screen-space rectangle (in pixels) where this view will be rendered on the render surface. |
| zoom | Initial zoom factor for the view. Values greater than 1 zoom in; values less than 1 zoom out. Default is 1 (no zoom). |
| zOrder | Draw order relative to other views. Lower values are drawn first (behind); higher values are drawn later (in front). Default is 0. |
| worldBoundsPx | Optional world-space bounds (in pixels) that limit where the camera can move. If null or RectangleF.Empty, the camera has no movement constraints. |
The newly created view's camera is initially positioned at world origin (0,0) and configured to snap to targets without smoothing. The view is automatically sorted by Z-order after being added.
◆ ClearViews()
| void Gondwana.Rendering.Views.ViewManager.ClearViews |
( |
| ) |
|
Removes all views from the manager, unsubscribing from their events and marking the scene as needing a full refresh.
This method cleanly detaches event handlers from each view's viewport before clearing the collection. After clearing, the scene is flagged for a full refresh to update the rendering state.
◆ ConfigureHorizontalSplit()
| void Gondwana.Rendering.Views.ViewManager.ConfigureHorizontalSplit |
( |
float | topZoom = 1f, |
|
|
float | bottomZoom = 1f ) |
Removes all existing views and creates a horizontal split-screen layout: top and bottom views sharing the full width of the render surface.
- Parameters
-
| topZoom | Initial zoom for the top view. |
| bottomZoom | Initial zoom for the bottom view. |
◆ ConfigureSingleFullView()
| void Gondwana.Rendering.Views.ViewManager.ConfigureSingleFullView |
( |
float | zoom = 1f, |
|
|
int | zOrder = 0 ) |
Removes all existing views and creates a single full-screen view that occupies the entire render surface adapter.
- Parameters
-
| zoom | Initial zoom level for the view. |
| zOrder | Z-order for the view (default 0). |
◆ ConfigureVerticalSplit()
| void Gondwana.Rendering.Views.ViewManager.ConfigureVerticalSplit |
( |
float | leftZoom = 1f, |
|
|
float | rightZoom = 1f ) |
Removes all existing views and creates a vertical split-screen layout: left and right views sharing the full height of the render surface.
- Parameters
-
| leftZoom | Initial zoom for the left view. |
| rightZoom | Initial zoom for the right view. |
◆ GetViewsAbove()
| IReadOnlyList< View > Gondwana.Rendering.Views.ViewManager.GetViewsAbove |
( |
View | view | ) |
|
Returns all views that are rendered in front of (above) the specified view, based on Z-order. Views with higher Z-order values appear in front.
- Parameters
-
| view | The reference view to find views above. |
- Returns
- A read-only list of views with higher Z-order than the specified view. Returns an empty collection if the view is not found or is already the top-most view.
◆ GetViewsBelow()
| IReadOnlyList< View > Gondwana.Rendering.Views.ViewManager.GetViewsBelow |
( |
View | view | ) |
|
Returns all views that are rendered behind (below) the specified view, based on Z-order. Views with lower Z-order values appear behind.
- Parameters
-
| view | The reference view to find views below. |
- Returns
- A read-only list of views with lower Z-order than the specified view. Returns an empty collection if the view is not found or is already the bottom-most view.
◆ Views
| ReadOnlyCollection<View> Gondwana.Rendering.Views.ViewManager.Views |
|
get |
Gets a read-only collection of all views currently managed by this view manager. Views are sorted by Z-order, with lower values appearing first (drawn behind).
A ReadOnlyCollection<T> of View instances.