Sign in to follow this  
sharathm

Sprites Help!! Plz!!!

Recommended Posts

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!!!!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ......

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