alpha+showcont
This commit is contained in:
@@ -178,7 +178,7 @@ namespace FlaxEditor.Modules.SourceCodeEditing
|
||||
/// <summary>
|
||||
/// The control types collection (for game UI).
|
||||
/// </summary>
|
||||
public readonly CachedTypesCollection Controls = new CachedTypesCollection(64, new ScriptType(typeof(Control)), IsTypeValidScriptingTypeControls, HasAssemblyValidScriptingTypes);
|
||||
public readonly CachedTypesCollection Controls = new CachedTypesCollection(64, new ScriptType(typeof(ContainerControl)), IsTypeValidScriptingTypeControls, HasAssemblyValidScriptingTypes);
|
||||
|
||||
/// <summary>
|
||||
/// The Animation Graph custom nodes collection.
|
||||
|
||||
40
Source/Engine/UI/GUI/Common/Panels/AlphaPanel.cs
Normal file
40
Source/Engine/UI/GUI/Common/Panels/AlphaPanel.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace FlaxEngine.GUI
|
||||
{
|
||||
/// <summary>
|
||||
/// Changes alpha of all its children
|
||||
/// </summary>
|
||||
public class AlphaPanel : ContainerControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The target alpha value
|
||||
/// </summary>
|
||||
public float Alpha;
|
||||
/// <summary>
|
||||
/// Whether or not we should ignore previous alphas
|
||||
/// </summary>
|
||||
public bool IgnoreStack;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Draw()
|
||||
{
|
||||
Render2D.PeekTint(out Color oldColor);
|
||||
if (IgnoreStack)
|
||||
{
|
||||
Color newColor = new Color(oldColor.R, oldColor.G, oldColor.B, Alpha);
|
||||
Render2D.PushTint(ref newColor, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Color newColor = new Color(oldColor.R, oldColor.G, oldColor.B, oldColor.A * Alpha);
|
||||
Render2D.PushTint(ref newColor, false);
|
||||
}
|
||||
base.Draw();
|
||||
|
||||
Render2D.PopTint();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user