public override async Task Execute() { SpriteFont font = await Content.LoadAsync <SpriteFont>("Segoe_UI_10_Regular"); FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font); XenkoRenderer.GraphicsContext = Game.GraphicsContext; uiRoot = new BasicUI(); debug = new DebugViewModel(uiRoot); uiRoot.DataContext = new BasicUIViewModel(); FontManager.Instance.LoadFonts(Content); SoundManager.Instance.LoadSounds(Content); ImageManager.Instance.LoadImages(Content); EffectManager.Instance.LoadEffects(EffectSystem); var scene = SceneSystem.SceneInstance.Scene; var compositor = ((SceneGraphicsCompositorLayers)scene.Settings.GraphicsCompositor); compositor.Master.Renderers.Add(new SceneDelegateRenderer(Render)); while (Game.IsRunning) { await Script.NextFrame(); debug.Update(); uiRoot.UpdateInput(Game.UpdateTime.Elapsed.TotalMilliseconds); uiRoot.UpdateLayout(Game.UpdateTime.Elapsed.TotalMilliseconds); } }
private void UpdateUI(float frameTimeInSeconds) { elapsedGameTime = frameTimeInSeconds * 1000; debug.Update(); root.UpdateInput(elapsedGameTime); root.UpdateLayout(elapsedGameTime); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { debug.Update(); basicUI.UpdateInput(gameTime.ElapsedGameTime.TotalMilliseconds); viewModel.Update(gameTime.ElapsedGameTime.TotalMilliseconds); basicUI.UpdateLayout(gameTime.ElapsedGameTime.TotalMilliseconds); base.Update(gameTime); }
protected override void Update(GameTime gameTime) { // Update Empty Keys UI basicUI.UpdateInput(gameTime.ElapsedGameTime.Milliseconds); basicUI.UpdateLayout(gameTime.ElapsedGameTime.Milliseconds); currentBoard.Update(gameTime); currentBoard.UpdateAnimation(gameTime); if (currentCamera != null && InputEngine.IsMouseRightHeld()) { Camera.Follow((InputEngine.MousePosition + Camera.CamPos), Helper.GraphicsDevice.Viewport, currentCamera.CameraSpeed); } base.Update(gameTime); }