using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HumanLikeBattleRobots.Data;
using HumanLikeBattleRobots.Logic;
using QuadEngine;

namespace HumanLikeBattleRobots.Graphic
{
    class InfoSprite: Sprite
    {
        private float health = 10;
        public InfoSprite(int stage)
            : base(stage)
        {
            relativeCenterPosition = new Vec2f(66, 110);
            drawTexture = GraphicResources.InfoPictureTexture;
        }

        public float Health { set { health = value; } }

        public override void Draw()
        {
            QuadColor color1 = QuadColor.Green.Lerp(QuadColor.Red, (10 - health) / 10);
            drawTexture.DrawRotAxis(this.DrawPosition - this.AxisPosition, this.angle, 1,
                this.DrawPosition, color1);
            GraphicResources.TestFont.TextOut(this.DrawPosition - this.AxisPosition + new Vec2f(60, 220), 1,
                GameManager.myRobot.Health.ToString()+"/10", color1, TqfAlign.qfaCenter);
            /*color1.A = 0.75f;
            drawTexture.DrawRotAxis(this.DrawPosition - this.AxisPosition, this.angle, 1.02,
                this.DrawPosition, color1);
            color1.A = 0.5f;
            drawTexture.DrawRotAxis(this.DrawPosition - this.AxisPosition, this.angle, 1.04,
                this.DrawPosition, color1);
            color1.A = 0.2f;
            drawTexture.DrawRotAxis(this.DrawPosition - this.AxisPosition, this.angle, 1.06,
                this.DrawPosition, color1);*/

        }
    }
}
