Vector4 Viewport { get; set; }

robot_2Generated
code_blocksInput

Description

The Viewport property of the CameraComponent class represents the size of the camera's view on the screen. This size is normalized between 0 and 1, meaning it is expressed as a fraction of the total screen size. The property is of type Vector4, which typically includes the x, y, width, and height components of the viewport.

Usage

To adjust the viewport of a camera in your scene, you can set the Viewport property of the CameraComponent instance. This allows you to control how much of the screen the camera's view should occupy. The values should be between 0 and 1, where 0 represents no space and 1 represents the full dimension of the screen.

Example

// Example of setting the Viewport property
CameraComponent camera = new CameraComponent();

// Set the viewport to occupy the top-left quarter of the screen
camera.Viewport = new Vector4(0, 0, 0.5f, 0.5f);