//Does exactly as the method is named, draws the objects on the screen
        public virtual void Draw(SpriteBatch sB, GraphicsDeviceManager gM)
        {
            foreach (CameraManager.Camera c in cameras.GetCameras())
            {
                managers.SetCurrentCam(c);
                gM.GraphicsDevice.Viewport = c.port;
                Vector2 displacement = cameras.GetDisplacement(c.commanderType);

                sB.Begin();

                backgrounds.DrawBackgrounds(sB, displacement);
                paths.Draw(sB, displacement);
                objects.DrawBottom(sB, displacement);
                particles.DrawBottom(sB, displacement);
                typeOfGame.DrawBottom(sB, displacement);

                abilities.DrawBottom(sB, displacement);
                projectiles.Draw(sB, displacement);
                agents.DrawLowest(sB, displacement);

                abilities.DrawTop(sB, displacement);
                particles.DrawTop(sB, displacement);
                objects.DrawTop(sB, displacement);
                typeOfGame.DrawTop(sB, displacement);
                agents.DrawHighest(sB, displacement);
                backgrounds.Drawforegrounds(sB, displacement);
                typeOfGame.DrawHUD(sB);
                cameras.GetHud(c).Draw(sB, managers);
                sB.End();
            }
        }
Example #2
0
        //Does exactly as the method is named, draws the objects on the screen
        public virtual void Draw(SpriteBatch sB, GraphicsDeviceManager gM, bool drawHUD)
        {
            foreach (CameraManager.Camera c in cameras.GetCameras())
            {
                managers.SetCurrentCam(c);
                gM.GraphicsDevice.Viewport = c.port;
                Vector2 displacement = cameras.GetDisplacement(c.commanderType);

                sB.Begin();

                backgrounds.DrawBackgrounds(sB, displacement);
                paths.Draw(sB, displacement);
                abilities.DrawBottom(sB, displacement);
                objects.DrawBottom(sB, displacement);
                particles.DrawBottom(sB, displacement);
                typeOfGame.DrawBottom(sB, displacement);

                projectiles.Draw(sB, displacement);
                agents.DrawLowest(sB, displacement);

                abilities.DrawTop(sB, displacement);
                spawns.Draw(sB, displacement);
                particles.DrawTop(sB, displacement);
                objects.DrawTop(sB, displacement);
                typeOfGame.DrawTop(sB, displacement);
                agents.DrawHighest(sB, displacement);
                backgrounds.Drawforegrounds(sB, displacement);

                if (drawHUD && cameras.GetPauser() == null)
                {
                    cameras.GetHud(c).Draw(sB, managers);
                }
                sB.End();
            }

            gM.GraphicsDevice.Viewport = cameras.GetFullSize();

            sB.Begin();
            cameras.DrawSplit(sB, managers);

            if (drawHUD && cameras.GetPauser() == null)
            {
                cameras.GetHud(cameras.GetCameras()[0]).DrawScores(sB, managers);
            }

            cameras.DrawPause(sB, managers);
            sB.End();
        }