Esempio n. 1
0
        public override void Init(object arg)
        {
            splashFont = GameStateManager.Content.Load <SpriteFont>("SplashScreenFont");

            loadingText = Strings.Loading;
            Vector2 size = splashFont.MeasureString(loadingText);

            loadingTextSize = new Point((int)size.X, (int)size.Y);

            backgroundTex = GameStateManager.Content.Load <Texture2D>("SplashScreen");
            progressTex   = GameStateManager.Content.Load <Texture2D>("SplashScreenLoad");

            contentTotal  = 0;
            contentLoaded = 0;

            SpriteBatch spriteBatch = new SpriteBatch(GameStateManager.GraphicsDevice);

            GameStateManager.GraphicsDevice.Clear(Color.Black);
            Render(spriteBatch);
            GameStateManager.GraphicsDevice.Present();

            contentTotal += Menu.ContentCount();
            contentTotal += CardResources.ContentCount();
            contentTotal += MessageWindow.ContentCount();

            nextGameState = GameState.Menu;

            Thread thread = new Thread(this.LoadContent);

            thread.Start();
        }