Jump to content
  • Advertisement
Sign in to follow this  
sharathm

Sprites Help!! Plz!!!

This topic is 4637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!