te
This commit is contained in:
parent
01151e679b
commit
57b2f0400e
265 changed files with 22828 additions and 6 deletions
92
Unused/Decal.Adapter.Wrappers/Hud.cs
Normal file
92
Unused/Decal.Adapter.Wrappers/Hud.cs
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Decal.Interop.Render;
|
||||
|
||||
namespace Decal.Adapter.Wrappers;
|
||||
|
||||
[CLSCompliant(true)]
|
||||
public class Hud : HudRenderScalable
|
||||
{
|
||||
private HUDView internalView;
|
||||
|
||||
internal HUDView Underlying => internalView;
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return internalView.Enabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
internalView.Enabled = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Id => internalView.ID;
|
||||
|
||||
/// <summary>
|
||||
/// Angle in Radians for rotation of the HUD
|
||||
/// </summary>
|
||||
public float Angle
|
||||
{
|
||||
get
|
||||
{
|
||||
return internalView.Angle;
|
||||
}
|
||||
set
|
||||
{
|
||||
internalView.Angle = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Alpha for entire hud
|
||||
/// </summary>
|
||||
public int Alpha
|
||||
{
|
||||
get
|
||||
{
|
||||
return internalView.Alpha;
|
||||
}
|
||||
set
|
||||
{
|
||||
internalView.Alpha = value;
|
||||
}
|
||||
}
|
||||
|
||||
internal event EventHandler Disposing;
|
||||
|
||||
internal Hud(HUDView view)
|
||||
: base(view)
|
||||
{
|
||||
internalView = view;
|
||||
}
|
||||
|
||||
public void SetBackground(Background background)
|
||||
{
|
||||
if (background != null)
|
||||
{
|
||||
internalView.SetBackground(background.Underlying);
|
||||
return;
|
||||
}
|
||||
throw new ArgumentNullException("background");
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (disposing && this.Disposing != null)
|
||||
{
|
||||
this.Disposing(this, new EventArgs());
|
||||
}
|
||||
Marshal.ReleaseComObject(internalView);
|
||||
internalView = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue