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

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

Performs painting of the control
protected Draw ( ) : void
Результат void
        protected override void Draw()
        {
            GraphicsDevice.Clear(TilesetXnaPanel.Settings.BackgroundColor);
            if (this._srcTexture != null)
            {
                int dim = Parent.ClientSize.Height;
                Width = dim * this._frames;
                int x, y;
                this._batch.Begin();
                for (int i = 0; i < this._frames; i++)
                {
                    x = (i % (this._srcTexture.Width / Constants.ANIMESIZE)) * Constants.ANIMESIZE;
                    y = (i / (this._srcTexture.Width / Constants.ANIMESIZE)) * Constants.ANIMESIZE;
                    this.srcRect = new Rectangle(x, y, Constants.ANIMESIZE, Constants.ANIMESIZE);
                    this.destRect = new Rectangle(i * dim, 0, dim, dim);
                    this._batch.Draw(this._srcTexture, this.destRect, this.srcRect, Color.White);
                    this._batch.DrawRectangle(i * dim - 1, 0, 1, dim + 1, Color.Black, 1);
                    if (this.SelectedId >= 0)
                    {
                        var rect = new Rectangle(this.SelectedId * dim - 1, 0, dim + 1, dim);
                        this._batch.DrawSelectionRect(rect, Color.White, 2);
                    }
                }
                this._batch.End();
            }
        }