예제 #1
0
 public static BackgroundController FromMetadata(BackgroundMetadata metadata, ContentManager content)
 {
     var controller =
         new BackgroundController(
             metadata.Layers.Select<ParallaxLayerMetadata, ScrollingBackground>(
                 x => ParallaxLayer.FromMetadata(x, content)));
     return controller;
 }
예제 #2
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();
        }