Hi
Anyone knows how to use the sprite interface properly?
i always get a different size than the one i want
also i dont know how to make the sprite transparent
please help
thanx
Hi there,
I literally -just- went through this problem. If you go to this post, you''ll see a short discussion of it:
http://www.gamedev.net/community/forums/topic.asp?topic_id=42265
Basically, you have to make sure your texture is square and has a length & width a power of 2. Then, you can specify what part of the texture you want to extract, the location you want to put it, and the size of the sprite, all from the Sprite interface''s Draw method...
Thanks,
Todd
I literally -just- went through this problem. If you go to this post, you''ll see a short discussion of it:
http://www.gamedev.net/community/forums/topic.asp?topic_id=42265
Basically, you have to make sure your texture is square and has a length & width a power of 2. Then, you can specify what part of the texture you want to extract, the location you want to put it, and the size of the sprite, all from the Sprite interface''s Draw method...
Thanks,
Todd
Thanks Todd
but i think in d3d (using quads to draw texture) width & height dont need to be a power of 2 right?
but i think in d3d (using quads to draw texture) width & height dont need to be a power of 2 right?
quote:Original post by Fpu
Thanks Todd
but i think in d3d (using quads to draw texture) width & height dont need to be a power of 2 right?
G''day!
The texture needs to have width & height that are powers of 2. The quads don''t have to be though. If your textures aren''t they will be re-sized and that can be ugly.
Stay Casual,
Ken
Drunken Hyena
Ken''s right - it can be ugly. My background was done similarly, and was resized twice (once when loading the texture to fit it into a power of 2, and once when displaying by resizing it back down). It actually made the background really fuzzy. So I resized my background texture to fit into a power of 2 and then just displayed the portion I needed, and now it looks great.
And making the texture size a power of 2 also works just as well while using the sprite interface for all my game pieces.
Thanks,
Todd
And making the texture size a power of 2 also works just as well while using the sprite interface for all my game pieces.
Thanks,
Todd
btw
if you guys wanna do some transparency
i have found out how it work by using the function createtexturefromfileex()
cya
if you guys wanna do some transparency
i have found out how it work by using the function createtexturefromfileex()
cya
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement