Exemplo n.º 1
0
        protected override void LoadContent()
        {
            LogHelper.Log("Game Root: Load Content..");

            _spriteBatch = new SpriteBatch(GraphicsDevice);

            try
            {
                _usedSkin = SkinLoader.Load(Content, GraphicsDevice, _settings.Skin);
            }
            catch (Exception e)
            {
                LogHelper.Log($"GameRoot: Error while opening Skin, using Default skin instead: {e}");
                _usedSkin      = SkinLoader.Load(Content, GraphicsDevice, "Default");
                _settings.Skin = "Default";
            }

            _skinAssetManager = new SkinAssetManager(GraphicsDevice, _settings);
            _skinAssetManager.Load <Texture2D>("Button.png");

            Services.AddService(_usedSkin);
            Services.AddService(_skinAssetManager);



            _screenComponent = new ScreenGameComponent(this);
            Components.Add(_screenComponent);
            PlaySongSelectScreen playSongSelectScreen = new PlaySongSelectScreen(this);

            _screenComponent.Register(playSongSelectScreen);
            GameplayScreen gameplayScreen = new GameplayScreen(this);

            _screenComponent.Register(gameplayScreen);
            PauseScreen ps = new PauseScreen(this);

            _screenComponent.Register(ps);

            _graphCanvas.Font = _usedSkin.Font;

            base.LoadContent();

            LogHelper.Log("Game Root: End Load Content");
        }
Exemplo n.º 2
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     SkinLoader.Load(this.Resources);
 }