Пример #1
0
        /// <summary>
        /// This function sets the context for the spriteloader.
        /// </summary>
        /// <param name="contentManager">content manager context.</param>
        public static void Initialize(ContentManager contentManager)
        {
            if (mInstance != null && contentManager != mInstance.manager)
            {
                throw new AggregateException("SpriteLoader already Initialized.");
            }

            mInstance = new SpriteLoader(contentManager);
        }
Пример #2
0
        /// <inheritdoc/>
        protected override void LoadContent()
        {
            this.spriteBatch = new SpriteBatch(GraphicsDevice);

            SpriteLoader.Initialize(this.Content);

            MediaPlayer.IsRepeating = true;

            this.SceneManager.SwitchScene(this.SceneManager.Menu);
        }
Пример #3
0
        /// <inheritdoc/>
        protected override void Initialize()
        {
            SpriteLoader.Initialize(this.Content);
            this.InitializeSql();

            // window size
            this.graphics.PreferredBackBufferWidth  = WindowWidth;
            this.graphics.PreferredBackBufferHeight = WindowHeight;
            this.graphics.GraphicsProfile           = GraphicsProfile.Reach;
            this.graphics.IsFullScreen = false;
            this.graphics.ApplyChanges();
            this.SceneManager = new SceneManager(this);

            base.Initialize();
        }