Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the screen manager component.
        /// </summary>
        public override void Initialize()
        {
            _spriteFonts = new SpriteFonts(_contentManager);
            base.Initialize();

            _isInitialized = true;
        }
        /// <summary>
        /// Initializes the screen manager component.
        /// </summary>
        public override void Initialize()
        {
            _spriteFonts = new SpriteFonts(_contentManager);
            base.Initialize();

            _isInitialized = true;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Load your graphics content.
        /// </summary>
        protected override void LoadContent()
        {
            // Load content belonging to the screen manager.
            ContentManager content = new ContentManager(this.Game.Services, "Content/Fonts");
            _spriteFonts = new SpriteFonts(content);
            spriteBatch = new SpriteBatch(GraphicsDevice);
            font = content.Load<SpriteFont>("menufont");
            blankTexture = Game.Content.Load<Texture2D>("Materials/blank");
            GameServices.AddService<GraphicsDevice>(this.Game.GraphicsDevice);
            GameServices.AddService<ContentManager>(this.Game.Content);

            // It is advised to use one instance of Random
            // because Random is seeded with the current time
            // initilizing random objects too quickly can cause
            // the impression of generating the same value
            // http://stackoverflow.com/questions/2727538/random-encounter-not-so-random
            GameServices.AddService<Random>(new Random());
            AxiosRandom.init();

            input.LoadContent();
            // Tell each of the screens to load their content.
            foreach (GameScreen screen in screens)
            {
                screen.Activate(false);
            }
        }