Based on the following code that uses a Sprite and Texture to draw a textured square...
_sprite.Begin( D3D.SpriteFlags.AlphaBlend );_sprite.Draw( _texture,
new Rectangle( 0, 0, (int)_width, (int)_height ),
new Vector3( 0.0f, 0.0f, 0.0f ),
new Vector3( (int)_left, (int)_top, 0.0f ),
Color.FromArgb( 255, 255, 255, 255 ) );
_sprite.End();
...I am confused as to what part of this code I can change to stretch my texture horizontally or vertically.
According to intellisense, the call parameters break down as follows: the texture (obviously), the area of the texture that you want to draw, the center of the texture, the position to draw at, and the color to use.
Which of these parameters could I adjust to make my texture stretch

Stretch texture
Kevin Draper
D3DXMATRIX matrix;
D3DXVECTOR2 scaleVec(2.0f, 1.0f);
D3DXVECTOR2 translationVec(10.0f, 10.0f);
// get the transform matrix for a scaling in the X coordinate and a translation of (10,10).. no rotation applied
D3DXMatrixTransformation2D(&matrix, 0, 0, &scaleVec, 0, 0, &translationVec);
sprite->SetTransform(&matrix);
Seraph_78
BillRP
FREDYCOREA
Okay, I've played around with it a bit... it looks like I'm supposed to pass in a matrix, but what am I supposed to do to the matrix so that the sprite knows it should stretch itself
I'm guessing there's a handy set of functions you can apply to a matrix somewhere...
Jim D.
Okay, that's basically it; thanks!
For C# purposes, I found that the calls look a little different, like this:
Matrix matrix = new Matrix();
Vector2 stretchVec = new Vector2(1.0f, 2.0f);
matrix.Scale(1.0f, 2.0f, 1.0f);
_sprite.Transform = matrix;
gotcf.net
you can't stretch the texture in that call. You can stretch(scale) / transform the sprite calling the SetTransform function.