Sign in to follow this  
Tano_ITA

[DX9] A little problem using the Sprite

Recommended Posts

Hello,
when i try to load my image and i draw it, it appears bigger than original. I've loaded a 800x600 image, but when i display it, it too bigger!

I can't understand how can i fix it..

[URL=http://img339.imageshack.us/i/immaginerc.jpg/][IMG]http://img339.imageshack.us/img339/1476/immaginerc.th.jpg[/IMG][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

The original image:

[URL=http://img197.imageshack.us/i/pressstartbutton.png/][IMG]http://img197.imageshack.us/img197/8887/pressstartbutton.th.png[/IMG][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]


This is my code:





m_sprite->Begin(D3DXSPRITE_ALPHABLEND);

D3DXVECTOR3 center(0.0f, 0.0f, 0.0f);
/*D3DXVECTOR3 position(300.0f, 500.0f, 0.0f);*/
D3DXVECTOR3 position(0.0f, 0.0f, 0.0f);

m_sprite->Draw(m_texture_sprite->texture, NULL, ¢er, &position, D3DCOLOR_ARGB(255, 255, 255, 0));

m_sprite->End();

Thanks a lot!

Share this post


Link to post
Share on other sites
I Solved using the D3DXMatrixTransformation2D() Methods. You can find all information here: http://www.toymaker.info/Games/html/sprites.html

Bye!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this