Represents a rendered view of a scene, combining a camera position with a viewport configuration to control what portion of the world is visible and how it is displayed on screen. Multiple views can be used to create split-screen, picture-in-picture, or other multi-viewport rendering scenarios.
More...
|
| void | ZoomAroundScreenPoint (SceneLayer layer, PointF screenPoint, float targetZoom, float durationSeconds) |
| | Smoothly zooms the view so that a given screen-space point appears to zoom in/out around a fixed world position beneath it, similar to map-style mouse-wheel zoom. Both the viewport zoom and camera position are animated over the specified duration.
|
| PointF | ScreenPxToWorldPx (SceneLayer layer, PointF screenPx) |
| | Converts a screen-space pixel position into world-space coordinates for the specified scene layer, accounting for the view's camera position, viewport zoom, screen offsets, and the layer's parallax factor.
|
| PointF | WorldPxToScreenPx (SceneLayer layer, PointF worldPx) |
| | Converts a world-space pixel position into screen-space coordinates for this view, accounting for the camera position, viewport zoom, screen offsets, and the specified layer's parallax factor.
|
| PointF | ScreenPxToGrid (SceneLayer layer, PointF screenPx) |
| | Converts a point in screen-space into the grid coordinate on the specified SceneLayer by first mapping the screen pixel to world-space, then letting the layer's coordinate system resolve the corresponding tile.
|
| RectangleF | WorldRectToScreenRect (SceneLayer layer, RectangleF worldRect) |
| | Converts a world-space pixel rectangle into a screen-space rectangle for this View, using the specified layer's parallax factor.
|
| RectangleF | ScreenRectToWorldRect (SceneLayer layer, RectangleF screenRect) |
| | Converts a screen-space rectangle (on the adapter) into a world-space rectangle for the given layer, respecting zoom, camera position, viewport offsets, and the layer's parallax factor.
|
|
| Guid | Id = Guid.NewGuid() [get] |
| | Gets the unique identifier for this view instance.
|
| Camera | Camera [get] |
| | Gets the camera that controls the world-space position and following behavior for this view. The camera determines which part of the world is visible.
|
| Viewport | Viewport [get] |
| | Gets the viewport that defines the screen-space rectangle, zoom level, and other rendering parameters for this view. The viewport controls how the camera's visible world region is mapped to screen pixels.
|
| int | ZOrder = 0 [get, set] |
| | Controls the draw order of this view relative to other views. Lower values are drawn first (behind); higher values are drawn later (in front).
|
| float | MinZoom = 0.1f [get, set] |
| | Gets or sets the minimum zoom level allowed for this View.
|
| float | MaxZoom = 8f [get, set] |
| | Gets or sets the maximum zoom level allowed for this View.
|
Represents a rendered view of a scene, combining a camera position with a viewport configuration to control what portion of the world is visible and how it is displayed on screen. Multiple views can be used to create split-screen, picture-in-picture, or other multi-viewport rendering scenarios.
◆ ScreenPxToGrid()
| PointF Gondwana.Rendering.Views.View.ScreenPxToGrid |
( |
SceneLayer | layer, |
|
|
PointF | screenPx ) |
Converts a point in screen-space into the grid coordinate on the specified SceneLayer by first mapping the screen pixel to world-space, then letting the layer's coordinate system resolve the corresponding tile.
- Parameters
-
| layer | The SceneLayer whose grid the point should be mapped onto. |
| screenPx | The pixel position relative to the RenderSurface. |
- Returns
- The grid coordinate (column/row or axial) under the screen pixel.
◆ ScreenPxToWorldPx()
| PointF Gondwana.Rendering.Views.View.ScreenPxToWorldPx |
( |
SceneLayer | layer, |
|
|
PointF | screenPx ) |
Converts a screen-space pixel position into world-space coordinates for the specified scene layer, accounting for the view's camera position, viewport zoom, screen offsets, and the layer's parallax factor.
- Parameters
-
| layer | The scene layer whose parallax factor should be used for the conversion. |
| screenPx | The screen-space pixel position relative to the render surface. |
- Returns
- The corresponding world-space pixel position.
The transformation formula is:
world = camera * parallax + (screen - offset) * zoom
This is commonly used for mouse picking and screen-to-world raycasting.
◆ ScreenRectToWorldRect()
| RectangleF Gondwana.Rendering.Views.View.ScreenRectToWorldRect |
( |
SceneLayer | layer, |
|
|
RectangleF | screenRect ) |
Converts a screen-space rectangle (on the adapter) into a world-space rectangle for the given layer, respecting zoom, camera position, viewport offsets, and the layer's parallax factor.
Inverse of: screen = offset + (world - camera * p) / zoom
◆ WorldPxToScreenPx()
| PointF Gondwana.Rendering.Views.View.WorldPxToScreenPx |
( |
SceneLayer | layer, |
|
|
PointF | worldPx ) |
Converts a world-space pixel position into screen-space coordinates for this view, accounting for the camera position, viewport zoom, screen offsets, and the specified layer's parallax factor.
- Parameters
-
| layer | The scene layer whose parallax factor should be used for the conversion. |
| worldPx | The world-space pixel position to convert. |
- Returns
- The corresponding screen-space pixel position on the render surface.
The transformation formula is:
screen = offset + (world - camera * parallax) / zoom
This is commonly used for rendering world objects to screen coordinates and for UI elements that track world positions.
◆ WorldRectToScreenRect()
| RectangleF Gondwana.Rendering.Views.View.WorldRectToScreenRect |
( |
SceneLayer | layer, |
|
|
RectangleF | worldRect ) |
Converts a world-space pixel rectangle into a screen-space rectangle for this View, using the specified layer's parallax factor.
Matches the render path: screen = offset + (world - camera * parallax) / zoom
- Parameters
-
| layer | Scene layer whose parallax should be applied. |
| worldRect | World-space rectangle (in pixels). |
- Returns
- Screen-space rectangle on the render surface.
◆ ZoomAroundScreenPoint()
| void Gondwana.Rendering.Views.View.ZoomAroundScreenPoint |
( |
SceneLayer | layer, |
|
|
PointF | screenPoint, |
|
|
float | targetZoom, |
|
|
float | durationSeconds ) |
Smoothly zooms the view so that a given screen-space point appears to zoom in/out around a fixed world position beneath it, similar to map-style mouse-wheel zoom. Both the viewport zoom and camera position are animated over the specified duration.
- Parameters
-
| layer | Reference layer whose parallax factor is used for the world-space transform. Typically the main gameplay layer (parallax = 1). |
| screenPoint | Mouse position in adapter/screen pixels relative to the render surface. |
| targetZoom | Desired zoom factor after the animation completes. |
| durationSeconds | Approximate duration in seconds for the zoom + pan animation. Values <= 0 snap immediately. |
◆ Camera
| Camera Gondwana.Rendering.Views.View.Camera |
|
get |
Gets the camera that controls the world-space position and following behavior for this view. The camera determines which part of the world is visible.
The Views.Camera instance associated with this view.
◆ Id
| Guid Gondwana.Rendering.Views.View.Id = Guid.NewGuid() |
|
get |
Gets the unique identifier for this view instance.
A GUID that uniquely identifies this view throughout its lifetime.
◆ MaxZoom
| float Gondwana.Rendering.Views.View.MaxZoom = 8f |
|
getset |
Gets or sets the maximum zoom level allowed for this View.
◆ MinZoom
| float Gondwana.Rendering.Views.View.MinZoom = 0.1f |
|
getset |
Gets or sets the minimum zoom level allowed for this View.
◆ Viewport
| Viewport Gondwana.Rendering.Views.View.Viewport |
|
get |
Gets the viewport that defines the screen-space rectangle, zoom level, and other rendering parameters for this view. The viewport controls how the camera's visible world region is mapped to screen pixels.
The Views.Viewport instance associated with this view.
◆ ZOrder
| int Gondwana.Rendering.Views.View.ZOrder = 0 |
|
getset |
Controls the draw order of this view relative to other views. Lower values are drawn first (behind); higher values are drawn later (in front).