Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Becks7

Sprites...

This topic is 5354 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

The sprites are displayed in different size than their original one .. How can i display my sprites in their real size ?

Share this post


Link to post
Share on other sites
Advertisement
Either make the texture that is loaded a power of 2 (1x1,2x2,4x4,16x16,32x32,64x64,128x128,256x256,512x512,1024x1024 etc).
Or load your texture using no filter (D3DX_FILTER_NONE IIRC, see DXSDK docs).
BTW: If you''re using D3DXCreateTextureFromFile, use D3DXCreateTextureFromFileEx, so you can set the filter.

Personally, I''d go for the texture, faster & easier, and you don''t have to change the code.

--
You''re Welcome,
Rick Wong
- sitting in his chair doing the most time-consuming thing..

Share this post


Link to post
Share on other sites
Hi!
Thank you very much!
I have changed the size of my texture , but now i have a new problem - this is not good for the collisions because now the image has a bigger size.
But maybe i will try to solve the problem with the filter.

Share this post


Link to post
Share on other sites
I have a somewhat related question. Does your texture have to be the same width by height. Because I have a 512x256 texture, and it seems to work fine, but I want to know ahead of time.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Some one on here told me I was wrong when I mentioned this "wrong size thing", as well, shows how much he knew. Sorry about that I was working really hard on this and the guy just basicly told me I was stupid or something. any way...
Using LoadtexturefromEx, is probably right (the best) way but another way is for your scaling, look at the size of your picture and then divide it by the next power of 2 up wards for both the height and width, that will give you the right scaling. So if your bitmap is 100 pixels high divide 100 by 128 and usr that result, which would be 0.781 as your scaling, so put 0.781f as the y scale do the same for width as well ie the next power of two higher than your bitmaps width.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!