Example #1
0
        public void Render(double deltaTime)
        {
            var ent             = EntityManager.GetEntiy <GameObject>(EntID);
            var outlineColorCom = ent.GetComponent <ColorValueCom>(OutlineColorAlias);
            var barColorCom     = ent.GetComponent <ColorValueCom>(BarColorAlias);
            var rectPosCom      = ent.GetComponent <IHaveHitBoxCom>(RectPosAlais);
            var timerCom        = ent.GetComponent <TimerCom>(TimerValueAlias);

            var timeRectangle = new Paultangle(rectPosCom.HitBox);

            timeRectangle.Width = (timerCom.Value / timerCom.EndTime) * timeRectangle.Width;

            ShapeExtensions.FillRectangle(SpriteBatch, timeRectangle.ToRectangleF(), barColorCom.Value);

            ShapeExtensions.DrawRectangle(SpriteBatch, rectPosCom.HitBox.ToRectangleF(), outlineColorCom.Value, (float)Thickness);
        }