Export (0) Print
Expand All

2D Graphics

This section discusses the basics of 2D rendering and includes examples of how to display sprites.

In This Section

2D Graphics Overview
Presents the basics of using sprites.
How To: Draw a Sprite
This article demonstrates how to draw a sprite by using the SpriteBatch class.
How To: Animate a Sprite
This article demonstrates how to animate a sprite from a texture using a custom class.
How To: Draw a Masked Sprite over a Background
This article demonstrates how to draw a foreground and background sprite using the SpriteBatch class, where only part of the foreground sprite masks the background. The foreground sprite in this example must include masking information.
How To: Make a Scrolling Background
This article demonstrates how to draw a scrolling background sprite using the SpriteBatch class.
How To: Rotate a Sprite
This article demonstrates how to rotate a sprite around its center.
How To: Rotate a Group of Sprites
This article demonstrates how to rotate a group of sprites around a single point using a rotation Matrix. It uses two methods; rotating the sprite positions manually during Update, and creating a rotation matrix during Update that SpriteBatch can use during Draw.
How To: Scale a Sprite
This article demonstrates how to scale a sprite using a uniform scale, nonuniform scale, or a destination rectangle.
How To: Tile a Sprite
This article demonstrates how to draw a sprite repeatedly in the x and y directions in one Draw call.
How To: Tint a Sprite
This article demonstrates how to tint a sprite using a Color value.
How To: Scale Sprites Based On Screen Size
This article demonstrates how to scale sprites using a matrix that is created based on the viewport width. This article applies only to Windows programming.
How To: Draw Point Sprites
This article demonstrates how to create and draw point sprites.
How To: Apply a Pixel Shader to Sprites
This article demonstrates how to apply a pixel shader to sprites.
How To: Draw a Sprite Over a Model
This article demonstrates how to draw a sprite so that it obscures a model.
How To: Draw Text
This article demonstrates how to import a SpriteFont into a project and draw text using DrawString.

Community Additions

ADD
Show:
© 2014 Microsoft