Nez.UI.Element.draw C# (CSharp) Method

draw() public method

If this method is overridden, the super method or {@link #validate()} should be called to ensure the widget is laid out.
public draw ( Graphics graphics, float parentAlpha ) : void
graphics Graphics Graphics.
parentAlpha float Parent alpha.
return void
		public virtual void draw( Graphics graphics, float parentAlpha )
		{
			validate();
		}

Usage Example

Esempio n. 1
0
        public override void draw(Graphics graphics, float parentAlpha)
        {
            validate();

            if (transform)
            {
                applyTransform(graphics, computeTransform());
            }
            if (_firstWidget != null && _firstWidget.isVisible())
            {
                var scissor = ScissorStack.calculateScissors(
                    stage?.camera,
                    graphics.batcher.transformMatrix,
                    _firstWidgetBounds);
                if (ScissorStack.pushScissors(scissor))
                {
                    graphics.batcher.enableScissorTest(true);
                    _firstWidget.draw(graphics, parentAlpha * color.A);
                    graphics.batcher.enableScissorTest(false);
                    ScissorStack.popScissors();
                }
            }

            if (_secondWidget != null && _secondWidget.isVisible())
            {
                var scissor = ScissorStack.calculateScissors(
                    stage?.camera,
                    graphics.batcher.transformMatrix,
                    _secondWidgetBounds);
                if (ScissorStack.pushScissors(scissor))
                {
                    graphics.batcher.enableScissorTest(true);
                    _secondWidget.draw(graphics, parentAlpha * color.A);
                    graphics.batcher.enableScissorTest(false);
                    ScissorStack.popScissors();
                }
            }

            _style.handle.draw(
                graphics,
                _handleBounds.x,
                _handleBounds.y,
                _handleBounds.width,
                _handleBounds.height,
                new Color(color, (int)(color.A * parentAlpha)));

            if (transform)
            {
                resetTransform(graphics);
            }
        }
All Usage Examples Of Nez.UI.Element::draw