Resizing a sprite?

Posts 112 of 12 · Page 1 of 1
Resizing a sprite?
How would you resize the sprite in whit's Combined base v2? i am just wondering thanks.
Make a new sprite
Delete half the bytes to make the sprite half its size.
Quote Originally Posted by NOOB View Post
Delete half the bytes to make the sprite half its size.
NO YO DONT YOU MAKE THE Z AXIS FAARTHER AWAY AND ITS SMALLER CAUSE ITS FARTHER AWAY
or don't use sprites? and draw it another way?
Not so sure, but basicly what i was asking how could i resize the image/sprite whit used on combined base v2
wtf create a new one make it 2x2[x*33/23*2:2:2:2^] should be supported xD
Quote Originally Posted by dean-wingess View Post
wtf create a new one make it 2x2[x*33/23*2:2:2:2^] should be supported xD
Yeah everyone knows what that means.
thats how im doing it

Code:
void CSprite::render()
{
	D3DXMATRIX matrix;
	m_sprite->GetTransform(&matrix);

	D3DXVECTOR2 translation = D3DXVECTOR2((FLOAT)m_iCurX, (FLOAT)m_iCurY);
	D3DXVECTOR2 scale = D3DXVECTOR2((FLOAT)m_fScaleFactorX, (FLOAT)m_fScaleFactorY);
	D3DXVECTOR2 scalecenter = D3DXVECTOR2((FLOAT)m_iCurW/2, (FLOAT)m_iCurH/2);

	D3DXMatrixTransformation2D(&matrix, &scalecenter, 0, &scale, 0, 0, &translation);

	m_sprite->SetTransform(&matrix);

	m_sprite->Begin(D3DXSPRITE_SORT_TEXTURE);
	m_sprite->Draw(m_tex, 0, 0, 0, D3DCOLOR_ARGB(m_iCurAlpha, 255, 255, 255));
	m_sprite->End();
}
Quote Originally Posted by Gordon` View Post
thats how im doing it

Code:
void CSprite::render()
{
	D3DXMATRIX matrix;
	m_sprite->GetTransform(&matrix);

	D3DXVECTOR2 translation = D3DXVECTOR2((FLOAT)m_iCurX, (FLOAT)m_iCurY);
	D3DXVECTOR2 scale = D3DXVECTOR2((FLOAT)m_fScaleFactorX, (FLOAT)m_fScaleFactorY);
	D3DXVECTOR2 scalecenter = D3DXVECTOR2((FLOAT)m_iCurW/2, (FLOAT)m_iCurH/2);

	D3DXMatrixTransformation2D(&matrix, &scalecenter, 0, &scale, 0, 0, &translation);

	m_sprite->SetTransform(&matrix);

	m_sprite->Begin(D3DXSPRITE_SORT_TEXTURE);
	m_sprite->Draw(m_tex, 0, 0, 0, D3DCOLOR_ARGB(m_iCurAlpha, 255, 255, 255));
	m_sprite->End();
}
Thanks for sharing i think scaling is the best for this :P
Posts 112 of 12 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?