Exemplo n.º 1
0
        public void RenderVisual()
        {
            EnsureRenderContext();

            var oldScissorRectangle = CrossEngineStuff.GetScissor();

            _renderContext.Begin();

            CrossEngineStuff.SetScissor(InternalBounds);
            _renderContext.View    = InternalBounds;
            _renderContext.Opacity = Opacity;

            if (Stylesheet.Current.DesktopStyle != null &&
                Stylesheet.Current.DesktopStyle.Background != null)
            {
                _renderContext.Draw(Stylesheet.Current.DesktopStyle.Background, InternalBounds);
            }

            foreach (var widget in ChildrenCopy)
            {
                if (widget.Visible)
                {
                    widget.Render(_renderContext);
                }
            }

            _renderContext.End();

            CrossEngineStuff.SetScissor(oldScissorRectangle);
        }
Exemplo n.º 2
0
        public void Render()
        {
            if (Bounds.IsEmpty)
            {
                return;
            }

            UpdateInput();
            UpdateLayout();

            EnsureRenderContext();

            var oldScissorRectangle = _renderContext.Batch.GraphicsDevice.ScissorRectangle;

            _renderContext.Begin();

            _renderContext.Batch.GraphicsDevice.ScissorRectangle = Bounds;
            _renderContext.View    = Bounds;
            _renderContext.Opacity = Opacity;

            foreach (var widget in WidgetsCopy)
            {
                if (widget.Visible)
                {
                    widget.Render(_renderContext);
                }
            }

            _renderContext.End();
            _renderContext.Batch.GraphicsDevice.ScissorRectangle = oldScissorRectangle;
        }
Exemplo n.º 3
0
        public void Render()
        {
            var newBounds = BoundsFetcher();

            if (_bounds != newBounds)
            {
                InvalidateLayout();
            }

            _bounds = newBounds;

            if (_bounds.IsEmpty)
            {
                return;
            }

            UpdateInput();
            UpdateLayout();

            if (_scheduleMouseWheelFocus != null)
            {
                if (_scheduleMouseWheelFocus.AcceptsMouseWheelFocus)
                {
                    _previousMouseWheelFocus = FocusedMouseWheelWidget;
                    FocusedMouseWheelWidget  = _scheduleMouseWheelFocus;
                }

                _scheduleMouseWheelFocus = null;
            }

            EnsureRenderContext();

            var oldScissorRectangle = CrossEngineStuff.GetScissor();

            _renderContext.Begin();

            CrossEngineStuff.SetScissor(_bounds);
            _renderContext.View    = _bounds;
            _renderContext.Opacity = Opacity;

            if (Stylesheet.Current.DesktopStyle != null &&
                Stylesheet.Current.DesktopStyle.Background != null)
            {
                _renderContext.Draw(Stylesheet.Current.DesktopStyle.Background, _bounds);
            }

            foreach (var widget in ChildrenCopy)
            {
                if (widget.Visible)
                {
                    widget.Render(_renderContext);
                }
            }

            _renderContext.End();

            CrossEngineStuff.SetScissor(oldScissorRectangle);
        }
Exemplo n.º 4
0
        public void Render()
        {
            if (Bounds.IsEmpty)
            {
                return;
            }

            UpdateInput();
            UpdateLayout();

            EnsureRenderContext();

            var oldScissorRectangle = CrossEngineStuff.GetScissor();

            _renderContext.Begin();

            CrossEngineStuff.SetScissor(Bounds);
            _renderContext.View    = Bounds;
            _renderContext.Opacity = Opacity;

            if (Stylesheet.Current.DesktopStyle != null &&
                Stylesheet.Current.DesktopStyle.Background != null)
            {
                _renderContext.Draw(Stylesheet.Current.DesktopStyle.Background, Bounds);
            }

            foreach (var widget in ChildrenCopy)
            {
                if (widget.Visible)
                {
                    widget.Render(_renderContext);
                }
            }

            _renderContext.End();

            CrossEngineStuff.SetScissor(oldScissorRectangle);
        }