float Size { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Size property of the Blur class in the Sandbox namespace specifies the intensity of the blur effect applied to the camera. It is a floating-point value that determines how much the image should be blurred.

This property is decorated with the RangeAttribute, which constrains its value between 0 and 1, with a step increment of 0.01. This ensures that the blur size is always within a reasonable range for visual effects.

The Size property is also marked with the PropertyAttribute, indicating that it can be exposed and manipulated in the editor or through scripts.

Usage

To use the Size property, you can set it directly on an instance of the Blur class. Adjusting this value will change the intensity of the blur effect applied to the camera.

For example, setting Size to 0.5f will apply a moderate blur effect, while setting it to 1.0f will apply the maximum blur effect.

Example

// Create a new Blur effect
Blur blurEffect = new Blur();

// Set the blur size to 0.5
blurEffect.Size = 0.5f;

// Apply the blur effect to a camera
SceneCamera camera = new SceneCamera();
blurEffect.RenderEffect(camera);