SpriteBatch.Draw Method (Texture2D, Vector2, Color)
XNA Game Studio 3.1
Adds a sprite to the batch of sprites to be rendered, specifying the texture, screen position, and color tint.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
public void Draw ( Texture2D texture, Vector2 position, Color color )
Parameters
- texture
- The sprite texture.
- position
- The location, in screen coordinates, where the sprite will be drawn.
- color
- The color channel modulation to use. Use Color.White for full color with no tinting.
| Exception type | Condition |
|---|---|
| ArgumentNullException | texture is null. |
| InvalidOperationException | Draw was called, but Begin has not yet been called. Begin must be called successfully before Draw can be called. |