using Engine.Input;
using Engine.Scene.Component.BuiltIn;

namespace DoomDeathmatch.Component.UI;

public class TestComponent : Engine.Scene.Component.Component
{
  private readonly IInputHandler _inputHandler = Engine.Engine.Instance.InputHandler!;
  public Camera? Camera { get; set; }

  public override void Update(double parDeltaTime)
  {
    if (Camera == null)
    {
      return;
    }

    GameObject.Transform.Size.Xy = 2 * Camera.ScreenToWorld(_inputHandler.MousePosition).Xy;
  }
}