Sprites Help!! Plz!!!
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!!!!
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 ......
e.a:
RECT abcRect;
abcRect.top = 0;
abcRect.left = 0;
abcRect.bottom = realheight;
abcRect.right = realwidth;
sprite->draw(texture,&abcRect ......
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement