D3DXSprite.Draw
Draws a simple sprite in screen-space.
object.Draw( _
SrcTexture As Direct3DTexture8, _
SrcRect As Any, _
Scaling As D3DVECTOR2, _
RotationCenter As D3DVECTOR2, _
Rotation As Single, _
Translation As D3DVECTOR2, _
Color As Long)
Parts
- object
- Object expression that resolves to a D3DXSprite object.
- SrcTexture
- A Direct3DTexture8 object, representing the source image used for the sprite.
- SrcRect
- A RECT type that indicates what portion of the source texture to use for the sprite. If this parameter is ByVal 0, then the entire source image is used for the sprite. However, you can specify a sub-rectangle of the source image instead. X and y mirroring can be specified easily by swapping the left and top and the right and bottom parameters of this RECT type.
- Scaling
- A D3DVECTOR2 type, the scaling vector.
- RotationCenter
- A D3DVECTOR2 type, a point that identifies the center of rotation.
- Rotation
- Value that specifies the rotation.
- Translation
- D3DVECTOR2 type, representing the translation.
- Color
- A value describing the color. The color and alpha channels are modulated by this value.
Error Codes
If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
Remarks
If D3DXSprite.Begin has not been called, this method internally calls Begin and D3DXSprite.End. When making successive calls to D3DXSprite.Draw and/or D3DXSprite.DrawTransform, make sure to call Begin to avoid the extra overhead of Draw and DrawTransform internally calling Begin and End each time.
See Also
D3DXSprite.DrawTransform