A rectangular window on the render target with its own zoom and placement. Viewport never moves the world; it only scales and positions the drawing.
More...
|
| void | Resize (int width, int height) |
| | Updates the viewport size while preserving its current on-screen origin. This is a convenience around TargetRectPx that only changes the width and height.
|
| void | SnapZoom (float zoom) |
| | Instantly sets the zoom level, raising the ZoomChanged event.
|
| void | ZoomTo (float targetZoom, float lerpPerSecond) |
| | Smoothly animates the zoom toward a target level using an exponential lerp rate in "per second" units. Values <= 0 snap immediately.
|
| void | ZoomToOverDuration (float targetZoom, float durationSeconds) |
| | Smoothly animates the zoom so that it reaches ~99% of the target level over approximately the given duration in seconds. Values <= 0 snap.
|
|
| Rectangle | TargetRectPx [get, set] |
| | Screen-space rectangle (in SCREEN / RenderSurface pixels) where this view is drawn. This defines the on-screen position and size of the viewport for this view.
|
| float | Zoom [get, set] |
| | Zoom factor applied to the world when rendering this view. Values greater than 1 zoom in, values between 0 and 1 zoom out. Used when converting between screen-space and world-space pixels.
|
| PointF | ScreenOffsetPx = PointF.Empty [get, set] |
| | Optional per-view HUD/safe-area offset in screen pixels.
|
| SizeF | VisibleWorldSizePx [get] |
| | World size visible through this viewport (used for Camera clamping).
|
A rectangular window on the render target with its own zoom and placement. Viewport never moves the world; it only scales and positions the drawing.
◆ Resize()
| void Gondwana.Rendering.Views.Viewport.Resize |
( |
int | width, |
|
|
int | height ) |
Updates the viewport size while preserving its current on-screen origin. This is a convenience around TargetRectPx that only changes the width and height.
- Parameters
-
| width | New viewport width in pixels. |
| height | New viewport height in pixels. |
◆ SnapZoom()
| void Gondwana.Rendering.Views.Viewport.SnapZoom |
( |
float | zoom | ) |
|
Instantly sets the zoom level, raising the ZoomChanged event.
◆ ZoomTo()
| void Gondwana.Rendering.Views.Viewport.ZoomTo |
( |
float | targetZoom, |
|
|
float | lerpPerSecond ) |
Smoothly animates the zoom toward a target level using an exponential lerp rate in "per second" units. Values <= 0 snap immediately.
◆ ZoomToOverDuration()
| void Gondwana.Rendering.Views.Viewport.ZoomToOverDuration |
( |
float | targetZoom, |
|
|
float | durationSeconds ) |
Smoothly animates the zoom so that it reaches ~99% of the target level over approximately the given duration in seconds. Values <= 0 snap.
◆ ScreenOffsetPx
| PointF Gondwana.Rendering.Views.Viewport.ScreenOffsetPx = PointF.Empty |
|
getset |
Optional per-view HUD/safe-area offset in screen pixels.
◆ TargetRectPx
| Rectangle Gondwana.Rendering.Views.Viewport.TargetRectPx |
|
getset |
Screen-space rectangle (in SCREEN / RenderSurface pixels) where this view is drawn. This defines the on-screen position and size of the viewport for this view.
◆ VisibleWorldSizePx
| SizeF Gondwana.Rendering.Views.Viewport.VisibleWorldSizePx |
|
get |
World size visible through this viewport (used for Camera clamping).
◆ Zoom
| float Gondwana.Rendering.Views.Viewport.Zoom |
|
getset |
Zoom factor applied to the world when rendering this view. Values greater than 1 zoom in, values between 0 and 1 zoom out. Used when converting between screen-space and world-space pixels.
◆ TargetRectChanged
Fired whenever TargetRectPx changes (viewport resized or moved). Provides the Viewport instance and the old and new rectangles.
◆ ZoomChanged
Occurs when the zoom level of the viewport changes.