ID3DXSprite::Draw
Draws a simple sprite in screen-space.
HRESULT Draw(
LPDIRECT3DTEXTURE8 pSrcTexture,
CONST RECT* pSrcRect,
CONST D3DXVECTOR2* pScaling,
CONST D3DXVECTOR2* pRotationCenter,
FLOAT Rotation,
CONST D3DVECTOR2* pTranslation,
D3DCOLOR Color
);
Parameters
- pSrcTexture
- [in] Pointer to an IDirect3DTexture8 interface, representing the source image used for the sprite.
- pSrcRect
- [in] A pointer to a RECT structure that indicates what portion of the source texture to use for the sprite. If this parameter is NULL, 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 structure.
Before transformation, the size of the sprite is defined by pSrcRect with the top-left corner at the origin (0,0).
- pScaling
- [in] Pointer to a D3DXVECTOR2 structure, the scaling vector. If this argument is NULL, it is treated as identity.
- pRotationCenter
- [in] Pointer to a D3DXVECTOR2 structure, a point that identifies the center of rotation. If this argument is NULL, it is treated as the point (0,0), which is the upper-left corner of the texture.
- Rotation
- [in] Value that specifies the rotation.
- pTranslation
- [in] Pointer to a D3DXVECTOR2 structure, representing the translation. If this argument is NULL, it is treated as identity.
- Color
- [in] D3DCOLOR type. The color and alpha channels are modulated by this value.
Return Values
If the method succeeds, the return value is D3D_OK.
If the method fails, the return value can be D3DERR_INVALIDCALL.
Remarks
If ID3DXSprite::Begin has not been called, this method will internally call Begin and ID3DXSprite::End. When making successive calls to ID3DXSprite::Draw and/or ID3DXSprite::DrawTransform, be sure to call Begin to avoid the extra overhead of Draw and DrawTransform internally calling Begin and End each time.
Header: Declared in D3dx8core.h.
Import Library: Use D3dx8.lib.
See Also
ID3DXSprite::DrawTransform