The ScreenRect
property of the CameraComponent
class represents the size of the viewport in screen coordinates. This property is crucial for determining the area of the screen that the camera will render.
The ScreenRect
property of the CameraComponent
class represents the size of the viewport in screen coordinates. This property is crucial for determining the area of the screen that the camera will render.
Use the ScreenRect
property to get or set the dimensions of the camera's viewport in screen coordinates. This can be useful for adjusting the camera's view dynamically based on the screen size or other factors.
// Example of accessing the ScreenRect property CameraComponent cameraComponent = new CameraComponent(); Rect currentScreenRect = cameraComponent.ScreenRect; // Set a new screen rectangle cameraComponent.ScreenRect = new Rect(0, 0, 1920, 1080);