MonoGdx.Graphics.G2D.GdxSpriteBatch.Draw C# (CSharp) Method

Draw() public method

public Draw ( TextureContext texture, Microsoft.Xna.Framework.Graphics.VertexPositionColorTexture vertices, int offset, int count ) : void
texture TextureContext
vertices Microsoft.Xna.Framework.Graphics.VertexPositionColorTexture
offset int
count int
return void
        public void Draw(TextureContext texture, VertexPositionColorTexture[] vertices, int offset, int count)
        {
            CheckValid(texture);

            if (count % 4 != 0)
                throw new ArgumentException("Vertices must be provided in multiples of 4");

            CheckState(texture);

            while (count > 0) {
                if (_vertices.Length - _vBufferIndex < count)
                    Flush();

                int copyCount = Math.Min(vertices.Length, count);
                Array.Copy(vertices, offset, _vertices, _vBufferIndex, copyCount);

                _vBufferIndex += copyCount;
                count -= copyCount;

                if (count == 0)
                    break;
            }
        }

Same methods

GdxSpriteBatch::Draw ( TextureContext texture, float x, float y, float width, float height, float u, float v, float u2, float v2 ) : void
GdxSpriteBatch::Draw ( TextureRegion region, float x, float y ) : void
GdxSpriteBatch::Draw ( TextureRegion region, float x, float y, float width, float height ) : void
GdxSpriteBatch::Draw ( TextureRegion region, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation ) : void

Usage Example

Esempio n. 1
0
        public void Draw(GdxSpriteBatch spriteBatch, float alphaModulation)
        {
            Color oldColor = Color;

            Color = oldColor.MultiplyAlpha(alphaModulation);

            spriteBatch.Draw(Texture, Vertices, 0, 4);

            Color = oldColor;
        }
All Usage Examples Of MonoGdx.Graphics.G2D.GdxSpriteBatch::Draw