コード例 #1
0
ファイル: ScreenEngine.cs プロジェクト: valsavva/dynacat
        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
            };
        }
コード例 #2
0
ファイル: ScreenEngine.cs プロジェクト: valsavva/dynacat
        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;
        }