示例#1
0
    public void SetGameOpacity(float gameOpacity)
    {
        if (gameOpacity >= 1.0)
        {
            IsOverlayEnabled = false;
            OverlayColor     = LinearColorA.Transparent;
            return;
        }

        IsOverlayEnabled = true;
        var alpha = Math.Clamp(1.0f - gameOpacity, 0.0f, 1.0f);

        OverlayColor = new LinearColorA(0, 0, 0, alpha);
    }
 public PackedLinearColorA(LinearColorA color) : this((byte)(color.R * 255.0f), (byte)(color.G * 255.0f), (byte)(color.B * 255.0f), (byte)(color.A * 255.0f))
 {
 }