Microsoft DirectX 8.1 (Visual Basic) |
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)
Before transformation, the size of the sprite is defined by SrcRect with the top-left corner at the origin (0,0).
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.
This method must be called between an Direct3DDevice8.BeginScene and Direct3DDevice8.EndScene pair.
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.
The image can be mirrored by specifying a negative vector in the appropriate direction (x, y, or both) for the Scaling parameter and adding the width and/or height of the source rectangle, specified in the SrcRect parameter, to the values specified in the Translation parameter. Note that this will change the point of origin for rotations.