public void Initialize(ITestResources resources) { InitializeTests(); sceneStack = new SceneStack(); font = new Font(resources.Fonts.Default); var fontProvider = resources.Fonts; scene = new UserInterfaceScene( resources.GraphicsDevice, resources.UserInterfaceRenderer, resources.LocalizedContent, resources.Fonts, resources.StyleConfigurator); spriteBatch = new SpriteBatch(resources.GraphicsDevice); var app = new TestSelectorApp(new TestSelectorProps { Tests = tests, OnAcceptTest = test => StartTest?.Invoke(this, new TestEventArgs(test)) }); var workspace = new Workspace("default", app); scene.Desktop.PushWorkspace(workspace); sceneStack.Add(scene); }
public void Initialize(ITestResources resources) { scene = new UserInterfaceScene( resources.GraphicsDevice, resources.UserInterfaceRenderer, resources.LocalizedContent, resources.StyleConfigurator) { DrawBelow = false, Theme = "FF", }; menu = new FF6Menu(m => Debug.WriteLine(m)); InitializeTestData(menu.Model = new FF6Model()); stack = resources.SceneStack; stack.Add(scene); scene.Initialize(); scene.Indicator = new PointerIndicator( resources.Content.Load <Texture2D>("UserInterface/Pointer")); menu.Begin(scene.Desktop); }
public void Initialize(ITestResources resources) { InitializeTests(); sceneStack = resources.SceneStack; font = new Font(resources.Fonts.Default); var fontProvider = resources.Fonts; scene = new UserInterfaceScene( resources.GraphicsDevice, resources.UserInterfaceRenderer, resources.LocalizedContent, resources.StyleConfigurator); spriteBatch = new SpriteBatch(resources.GraphicsDevice); var menu = new Menu(); foreach (var test in tests) { menu.Add(test.Name, () => StartTest?.Invoke(this, new TestEventArgs(test))); } var workspace = new Workspace("default"); workspace.Add(menu); scene.Desktop.PushWorkspace(workspace); sceneStack.Add(scene); }
private void StartTitle() { var title = sceneFactory.CreateTitleScene(); scenes.Add(title); title.BeginGame += player => { var game = sceneFactory.CreateGamePlayScene(); game.Run(player); scenes.Remove(title); scenes.Add(game); game.SceneEnd += (_, __) => StartTitle(); }; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { base.Initialize(); content = new ContentProvider(Content); scenes.Add(new App(GraphicsDevice, Window, content)); Window.Title = "Shoot the Traps"; }
public BBX(BBXFactory bbxFactory, HighscoreCollection highscores) { SplashScene splashScene = bbxFactory.CreateSplashScene(); splashScene.SceneEnd += (_, __) => StartTitle(); scenes.Add(splashScene); this.bbxFactory = bbxFactory; this.highscores = highscores; }