コード例 #1
0
ファイル: BackgroundController.cs プロジェクト: sergik/Cardio
 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();
        }