   Scaling a sprite
  Well, I''ve been using the following piece of code to achieve rotation and scaling with my D3DXSprite:   D3DXMATRIX Result;D3DXMATRIX Original;Graphics->GetD3DXSprite()->GetTransform(&Original);D3DXVECTOR2 Center;Center.x = m_Position.x + ((m_SizeX) / 2);Center.y = m_Position.y + ((m_SizeY) / 2); D3DXMatrixTransformation2D(   &Result,    &Center,   0,   &m_Scale,   &Center,   m_Rotation,   &D3DXVECTOR2(0,0)  );Graphics->GetD3DXSprite()->SetTransform(&Result);Graphics->GetD3DXSprite()->Draw(m_Texture,&toDraw,NULL,&m_Position,m_ModColor);Graphics->GetD3DXSprite()->SetTransform(&Original);and, although it''s scaling, it is always related to (0,0), no matter what I pass as ScalingCenter. Any thoughts on that?Thanks in advance   --------------------------------------------------------- There are 10 kinds of people: those who know binary and those who don''t 
  This worked for me:int CSprite_D3DX::Draw(){// Build a source RECT which will copy only a small portion of the texture.// Also, you will notice that NumFramesWide is used for both TOP and LEFT// This is correct    srcRect.top    = (( CurrentFrame / NumFramesWide ) * FrameHeight);    srcRect.left   = (( CurrentFrame % NumFramesWide ) * FrameWidth);srcRect.bottom = srcRect.top  + FrameHeight;    srcRect.right  = srcRect.left + FrameWidth;D3DXVECTOR2 vCenter( 0.0f, 0.0f );D3DXVECTOR2 vScale( scalex, scaley );D3DXVECTOR2 vPosition( (float)x, (float)y );D3DXVECTOR2 vRotationCenter( (float)rotxcenter, (float)rotycenter);D3DXMATRIX mat;D3DXMatrixTransformation2D(&mat,&vCenter,NULL,&vScale,&vRotationCenter,rotation,&vPosition);D3DSprite->SetTransform(&mat);//Add the sprite to the Sprite buffer (actually gets drawn when the Sprite->End executes)D3DSprite->Draw( D3DSpriteTexture, &srcRect, NULL, NULL, D3DCOLOR_COLORVALUE(Red, Green, Blue, Alpha) );return true;}   just change the "vRotationCenter"Wait...sorry...I assumed you meant rotation.  lolmine scales at 0,0 too.  hmmmmmm....-cb   ~ c   o l ec o ~  Rock the cradle of love!You stupid WANKER!S i g n a l D E V .comMetroid Classic [edited by - coleco on February 17, 2004 10:18:17 AM];  Well, what''s that then? A bug maybe? Or is there another right way to do this. Anyway, I can adjust the Sprite''s position to look as if it was being scaled around it''s position, but if there''s a ScalingCenter parameter, I wonder why it doesn''t work...   --------------------------------------------------------- There are 10 kinds of people: those who know binary and those who don''t 