ARCed.Controls.AnimationXnaPanel.Draw C# (CSharp) Метод

Draw() защищенный Метод

Performs painting of the control
protected Draw ( ) : void
Результат void
        protected override void Draw()
        {
            GraphicsDevice.Clear(Color.Black);

            this._batch.Begin();
            this.DrawBackground();

            Rectangle destRect;
            Rectangle srcRect;
            foreach (FrameSprite sprite in this._sprites)
            {
                srcRect = new Rectangle(0, 0, sprite.Width, sprite.Height);
                destRect = new Rectangle(sprite.X / 2, sprite.Y / 2, sprite.Width / 2, sprite.Height / 2);
                this._batch.Draw(sprite.Texture, destRect, srcRect, Color.White);
                this._batch.DrawRectangle(destRect, Color.Blue, 2);
                this._batch.FillTriangle(
                    new Vector2(destRect.X, destRect.Y),
                    new Vector2(destRect.X + 16, destRect.Y),
                    new Vector2(destRect.X, destRect.Y + 16),
                    Color.Blue);
                this._batch.DrawString(sprite.Index.ToString(), this._font, Color.Black,
                    new Rectangle(destRect.X, destRect.Y - 2, 16, 16));
            }
            this._batch.End();
        }