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;
///
/// Returns the Area scaling has caused the Hud to encompass
///
public Rectangle ScaleRect => Util.toRectangle(myScalable.ScaleRect);
///
/// 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
///
public float ScaleFactor
{
get
{
return myScalable.ScaleFactor;
}
set
{
myScalable.ScaleFactor = value;
}
}
///
/// Specifies whether or not Scaling is occuring (setting to false disables scaling)
///
public bool Scaling
{
get
{
return myScalable.Scaling;
}
set
{
myScalable.Scaling = value;
}
}
[CLSCompliant(false)]
protected HudRenderScalable(IRenderScalable newTarget)
: base(newTarget)
{
myScalable = newTarget;
}
///
/// Scales the Hud to fill the area specified
///
/// Area for the Hud to encompass
public void ScaleTo(Rectangle rect)
{
tagRECT pArea = Util.toTagRECT(rect);
myScalable.ScaleTo(ref pArea);
}
}