Exemplo n.º 1
0
        void RenderHarv(Sprite sprite)
        {
            sprite.Draw(statusHarvBackground, 405, 580, ColorValue.White);


            int harvHPBarWidth = (int)(statusHPBarBarValue.Width * selectedHarv.HealthValue / selectedHarv.GetProps().HP);
            int harvSTBarWidth = (int)(statusHPBarBarValue.Width * selectedHarv.CurrentStorage / selectedHarv.GetProps().Storage);

            string hpInfo = ((int)selectedHarv.HealthValue).ToString() + "/" + ((int)selectedHarv.GetProps().HP).ToString();
            string stInfo = ((int)selectedHarv.CurrentStorage).ToString() + "/" + ((int)selectedHarv.GetProps().Storage).ToString();


            sprite.Draw(statusHarvBackground, 405, 580, ColorValue.White);

            sprite.Draw(statusHPBarBarValue, new Rectangle(562, 640, harvHPBarWidth, statusHPBarBarValue.Height),
                        new Rectangle(0, 0, harvHPBarWidth, statusHPBarBarValue.Height), ColorValue.White);
            sprite.Draw(statusHPBarBarEdge, 544, 637, ColorValue.White);


            sprite.Draw(statusSTBarBarValue, new Rectangle(679, 672, harvSTBarWidth, statusSTBarBarValue.Height),
                        new Rectangle(0, 0, harvSTBarWidth, statusSTBarBarValue.Height), ColorValue.White);
            sprite.Draw(statusSTBarBarEdge, 661, 666, ColorValue.White);

            Matrix trans = Matrix.Scaling(0.8f, 0.8f, 1) * Matrix.Translation(new Vector3(715, 667, 0));

            sprite.SetTransform(trans);
            f8.DrawString(sprite, stInfo, 0, 0, ColorValue.White);
            sprite.SetTransform(Matrix.Identity);
        }