Exemplo n.º 1
0
        public override void Initialize()
        {
            LoadingScreen.ScreenLoaded += OnScreenLoaded;

            _camera = new Camera2D();
            _camera.Initialize(_screenManager.Game);

            _backgroundController =
                BackgroundController.FromMetadata(
                    _screenManager.Game.Content.Load<BackgroundMetadata>(@"Backgrounds\Default"),
                    _screenManager.Game.Content);
            _backgroundController.Initialize(_screenManager.Game, _screenManager.SpriteBatch, _camera);

            base.Initialize();
        }
Exemplo n.º 2
0
 public static BackgroundController FromMetadata(BackgroundMetadata metadata, ContentManager content)
 {
     var controller = new BackgroundController(metadata.Layers.Select(x => ParallaxLayer.FromMetadata(x, content)));
     return controller;
 }