[gameprogrammer] ID3DXSprite translation problem
- From: "Roman Hwang" <hwang.roman@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Sun, 1 Jun 2008 14:34:21 +0300
Hello.
I am trying to make simple GUI through ID3DXSprite. And I faced a problem
with sprite's posiition.
I made a button and I wanted to click it by handling WM_LBUTTONDOWN.
When I am trying to draw a sprite in x=60, y=200, the sprite's position is
different. It is about 59, 190.
But in 0, 0 everything is ok.
Maybe somebody had the same problem.
Here is the code.
D3DXMATRIX res;
D3DXVECTOR2 scale(1.0f, 1.0f);
D3DXVECTOR2 translate(0, 200);
D3DXMatrixTransformation2D(&res, NULL, 0.0, &scale, NULL, 0.0f, &translate);
sprite->SetTransform(&res);
if (!upPressed)
{
sprite->Draw(texture, NULL, NULL, NULL, D3DCOLOR_ARGB(255, 255, 255, 255));
}
else
{
sprite->Draw(texturePressed, NULL, NULL, NULL, D3DCOLOR_ARGB(255, 255, 255,
255));
}
Best regards,
Hwang Roman
- Follow-Ups:
- [gameprogrammer] Re: ID3DXSprite translation problem
- From: Alan Wolfe
Other related posts:
- » [gameprogrammer] ID3DXSprite translation problem
- » [gameprogrammer] Re: ID3DXSprite translation problem
- » [gameprogrammer] Re: ID3DXSprite translation problem
- » [gameprogrammer] Re: ID3DXSprite translation problem
- [gameprogrammer] Re: ID3DXSprite translation problem
- From: Alan Wolfe