Archived

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

Becks7

Sprites...

Recommended Posts

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