Пример #1
0
        public override void Draw(GameTime gameTime)
        {
            GuiHelper.SetScissor(Clip);

            int halfWidth     = (int)(Width / 2);
            int iconHalfWidth = (int)(PrefWidth / 2);

            int halfHeight     = (int)(Height / 2);
            int iconHalfHeight = (int)(PrefHeight / 2);

            Vector2 pos = new Vector2(Left + halfWidth - iconHalfWidth, Top + halfHeight - iconHalfHeight);

            GuiHelper.SpriteBatch.Draw(Region, pos, Color.White);

            GuiHelper.ResetScissor();
        }
Пример #2
0
 /// <summary>
 /// Sets the drawing limits for this component.
 /// </summary>
 public virtual void SetScissor()
 {
     _oldScissor = _s.GraphicsDevice.ScissorRectangle;
     GuiHelper.SetScissor(ClippingRect);
 }