Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 private void UpdateUI(float frameTimeInSeconds)
 {
     elapsedGameTime = frameTimeInSeconds * 1000;
     debug.Update();
     root.UpdateInput(elapsedGameTime);
     root.UpdateLayout(elapsedGameTime);
 }
Esempio n. 3
0
        /// <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);
        }
Esempio n. 4
0
        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);
        }