Beispiel #1
0
        //****************************************
        // THIS IS FOR THE MINION CLASS
        //****************************************
        public UI(Game game, SpriteBatch spriteBatch, Camera2D cam, MouseHandler mH, MinionBase m)
        {
            this.game = game;
            this.spriteBatch = spriteBatch;
            this.cam = cam;
            this.mH = mH;

            pos = new Vector2(m.Position.X, m.ImageRec.Height);
            progBox = game.Content.Load<Texture2D>("UtilityTextures/RedBox");
            healthBox = game.Content.Load<Texture2D>("UtilityTextures/RedBox");
            size = new Rectangle((int)m.Position.X, (int)m.Position.Y, m.ImageRec.Width / 10, 10);
            sBar = new StatusBar(m.Position, healthBox, health, size, "Right", spriteBatch, cam);
            //font
            spriteName = game.Content.Load<SpriteFont>("menufont");
            fontLoc = new Vector2(m.Position.X, m.Position.Y - 10);
            name = m.UnitName;
        }
Beispiel #2
0
        //****************************************
        // THIS IS FOR THE BUILDING CLASS
        //****************************************
        public UI(Game game, SpriteBatch spriteBatch, Camera2D cam, MouseHandler mH, Building b)
        {
            this.game = game;
            this.spriteBatch = spriteBatch;
            this.cam = cam;
            this.mH = mH;

            pos = new Vector2(b.Position.X, b.ImageRec.Height);
            size = new Rectangle((int)b.Position.X, (int)b.Position.Y, b.ImageRec.Width / 10, 10);
            progBox = game.Content.Load<Texture2D>("UtilityTextures/RedBox");
            healthBox = game.Content.Load<Texture2D>("UtilityTextures/RedBox");
            sBar = new StatusBar(pos, healthBox, health, size, "Right", spriteBatch, cam);

            //font
            spriteName = game.Content.Load<SpriteFont>("menufont");
            fontLoc = new Vector2(b.Position.X, b.Position.Y - 10);
            name = b.UnitName;
            //Console.WriteLine("Font Location: " + fontLoc.X + ", " + fontLoc.Y);
        }
Beispiel #3
0
        private void GetObject(MinionBase m)
        {
            pos = new Vector2(m.Position.X, m.Position.Y + m.ImageRec.Height);

            //font
            name = m.UnitName;
            fontLoc.X = m.Position.X;
            fontLoc.Y = m.Position.Y - 20;
            //end font

            health = m.Health;

            size = new Rectangle((int)pos.X, (int)pos.Y, m.ImageRec.Width / 10, 10);
            h = new Texture2D[health];
            sBar = new StatusBar(pos, healthBox, health, size, "Right", spriteBatch, cam);
        }
Beispiel #4
0
        private void GetObject(Building b)
        {
            pos = new Vector2(b.Position.X, b.ImageRec.Height + b.Position.Y);

            //font
            name = b.UnitName;
            fontLoc.X = b.Position.X;
            fontLoc.Y  =  b.Position.Y - 20;
            //end font

            health = b.Health;

            size = new Rectangle((int)pos.X, (int)pos.Y, b.ImageRec.Width / 10, 10);
            h = new Texture2D[health];
            sBar = new StatusBar(pos, healthBox, health, size, "Right", spriteBatch, cam);
        }