Sprites Help!! Plz!!!

Started by
6 comments, last by sharathm 18 years, 5 months ago
I have been trying to write a simple GUI for my game using Sprites. I have a 160 x 80 size file from which i am loading an image for my button. although the image loads fine it is enlarged in the scene when it is displayed. For testing i am loading the image at center(0,0,0) and origin(0,0,0) but still it is enlarged..if i increase the z-co ordinates of center or origin the image is never displayed. I just want to load the image in its size..i dont want it scaled. Does anyone know wat the problem is.. Plz Help!!!!
Advertisement
Are you drawing in in ortho mode?

Matt
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
Are you using DirectX or OpenGL?
ortho mode?
Matt : mattb0001@hotmail.comClick me please
No...Not in Ortho Mode...am using a normal camera setup.
Am using DirectX9..
well one of the first rule I learn with 3d is that you use powers of 2. Try using a 256x256 texture instead of a non power of two texture. You can always put the texture you need in the upper-left corner for drawing purposes. If your graphics card supports it you can use non power of two textures but you still have to make the quad the right ratio acording to you texture.
than tell the draw method of the sprite the srcRect. (of the texture)

e.a:

RECT abcRect;

abcRect.top = 0;
abcRect.left = 0;
abcRect.bottom = realheight;
abcRect.right = realwidth;

sprite->draw(texture,&abcRect ......
Ok Thank You...

This topic is closed to new replies.

Advertisement