Example #1
0
        public void Render(DwarfTime time, SpriteBatch batch, Vector2 globalOffset)
        {
            GlobalOffset = globalOffset;


            RootComponent.LocalBounds = new Rectangle((int)globalOffset.X, (int)globalOffset.Y, 0, 0);
            RootComponent.UpdateTransformsRecursive();
            RootComponent.Render(time, batch);

            if (FocusComponent != null)
            {
                FocusComponent.Render(time, batch);
            }


            foreach (GUIComponent component in DrawAfter)
            {
                component.Render(time, batch);
            }


            DrawAfter.Clear();

            if (DebugDraw)
            {
                RootComponent.DebugRender(time, batch);
            }
        }
Example #2
0
        public void Update(DwarfTime time)
        {
            RootComponent.LocalBounds = new Rectangle(0, 0, GameState.Game.GraphicsDevice.Viewport.Width, GameState.Game.GraphicsDevice.Viewport.Height);
            ToolTipManager.Update(time);

            if (!IsMouseVisible)
            {
                return;
            }

            if (FocusComponent == null)
            {
                RootComponent.Update(time);
            }
            else
            {
                FocusComponent.Update(time);
            }

            LastScrollWheel = Mouse.GetState().ScrollWheelValue;
        }