te
This commit is contained in:
parent
01151e679b
commit
57b2f0400e
265 changed files with 22828 additions and 6 deletions
66
Unused/Decal.Adapter.Wrappers/HudRenderScalable.cs
Normal file
66
Unused/Decal.Adapter.Wrappers/HudRenderScalable.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using Decal.Adapter.Support;
|
||||
using Decal.Interop.Core;
|
||||
using Decal.Interop.Render;
|
||||
|
||||
namespace Decal.Adapter.Wrappers;
|
||||
|
||||
[CLSCompliant(true)]
|
||||
public class HudRenderScalable : HudRenderTarget
|
||||
{
|
||||
private IRenderScalable myScalable;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Area scaling has caused the Hud to encompass
|
||||
/// </summary>
|
||||
public Rectangle ScaleRect => Util.toRectangle(myScalable.ScaleRect);
|
||||
|
||||
/// <summary>
|
||||
/// Scale the width and height of the Hud by the specified value keeping the current position.
|
||||
/// This will not return 'good' values when using ScaleTo
|
||||
/// </summary>
|
||||
public float ScaleFactor
|
||||
{
|
||||
get
|
||||
{
|
||||
return myScalable.ScaleFactor;
|
||||
}
|
||||
set
|
||||
{
|
||||
myScalable.ScaleFactor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether or not Scaling is occuring (setting to false disables scaling)
|
||||
/// </summary>
|
||||
public bool Scaling
|
||||
{
|
||||
get
|
||||
{
|
||||
return myScalable.Scaling;
|
||||
}
|
||||
set
|
||||
{
|
||||
myScalable.Scaling = value;
|
||||
}
|
||||
}
|
||||
|
||||
[CLSCompliant(false)]
|
||||
protected HudRenderScalable(IRenderScalable newTarget)
|
||||
: base(newTarget)
|
||||
{
|
||||
myScalable = newTarget;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scales the Hud to fill the area specified
|
||||
/// </summary>
|
||||
/// <param name="rect">Area for the Hud to encompass</param>
|
||||
public void ScaleTo(Rectangle rect)
|
||||
{
|
||||
tagRECT pArea = Util.toTagRECT(rect);
|
||||
myScalable.ScaleTo(ref pArea);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue