Exemple #1
0
        public ScreenEngine(GameEngine game, string fileName)
        {
            this.game     = game;
            this.Content  = new ContentManager(game.Services, GameEngine.ContentRootDirectory);
            this.FileName = fileName;

            this.CurrentEvents = new Dictionary <string, bool>();
            this.tapAreas      = new List <XTapArea>();
            this.obstacles     = new List <XElement>();

            this.spriteBatch = new SpriteBatchWithFloats(this.game.GraphicsDevice);

            if (this.game.Scale != Vector3.One)
            {
                scaleMatrix = Matrix.CreateScale(this.game.Scale);
            }

            this.initializeParameters = new InitializeParameters()
            {
                Game = game, ScreenEngine = this
            };
            this.updateParameters = new UpdateParameters()
            {
                Game = game, ScreenEngine = this
            };
            this.drawParameters = new DrawParameters()
            {
                Game = game, ScreenEngine = this, SpriteBatch = spriteBatch
            };
        }
Exemple #2
0
        public virtual void Unload()
        {
            this.RootComponent.Dispose();
            this.RootComponent = null;

            this.spriteBatch.Dispose();
            this.spriteBatch = null;

            this.Content.Unload();
            this.Content.Dispose();
            this.Content = null;

            this.obstacles = null;
        }