// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine.GUI
{
///
/// The blur panel that applied the Gaussian-blur to all content beneath the control.
///
///
public class BlurPanel : ContainerControl
{
///
/// Gets or sets the blur strength. Defines how blurry the background is. Larger numbers increase blur, resulting in a larger runtime cost on the GPU.
///
[EditorOrder(0), Limit(0, 100, 0.0f), Tooltip("Blur strength defines how blurry the background is. Larger numbers increase blur, resulting in a larger runtime cost on the GPU.")]
public float BlurStrength { get; set; }
///
/// Initializes a new instance of the class.
///
public BlurPanel()
{
}
///
public override void Draw()
{
base.Draw();
float strength = BlurStrength;
if (strength > Mathf.Epsilon)
{
Render2D.DrawBlur(new Rectangle(Vector2.Zero, Size), strength);
}
}
}
}