Beispiel #1
        //The constructor is private because when we want to use a loadingscreen we should use the static Load function
        private LoadingScreen(ScreenManager screenManager, bool loadingIsSlow, GameScreen[] screensToLoad)
            this.loadingIsSlow = loadingIsSlow;
            this.screensToLoad = screensToLoad;

            TransitionOnTime = TimeSpan.FromSeconds(0.5);
Beispiel #2
        //This function is to be used when we want to use a loadingscreen
        public static void Load(ScreenManager screenManager, bool loadingIsSlow, params GameScreen[] screensToLoad)
            //Tell all screens to transition off
            foreach (GameScreen screen in screenManager.GetScreens())

            //Create the loadingscreen
            LoadingScreen loadingScreen = new LoadingScreen(screenManager, loadingIsSlow, screensToLoad);

            //and finally activate the loadingscreen
Beispiel #3
        protected override void LoadContent()
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            screenManager = new ScreenManager(this);
            screenManager.SpriteBatch = spriteBatch;
            screenManager.Font = Content.Load<SpriteFont>("GUI Textures/Fonts/DejaVuSans_20");
            screenManager.BlankTexture = Content.Load<Texture2D>("GUI Textures/BlankTexture");
            //screenManager.TraceEnabled = true;

            screenManager.AddScreen(new BackgroundScreen());
            screenManager.AddScreen(new MainMenuScreen());

            Camera.Limits = new Rectangle(0, 0, 800, 600);
            // TODO: use this.Content to load your game content here

            var pp = GraphicsDevice.PresentationParameters;
            ShaderTarget = new RenderTarget2D(GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight);
            MainTarget = new RenderTarget2D(GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight);