Archived

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

Toyemann

Sprite in wrong size

Recommended Posts

Toyemann    122
I''m trying to load a sprite on to a screen, but it''s displaying in wrong scale. It''s little larger than the original bitmap. Any idea what''s going on?

Share this post


Link to post
Share on other sites
Drakonite    215
in the words of Johny 5....
Need input.

What are you using? Directdraw? Some DX8 thing? Are you using blit()? bltfast? Need input.



Drakonite

[Insert Witty Signature Here]

Share this post


Link to post
Share on other sites
Toyemann    122
I''m using DX8 in 800x600 resolution.
I used the D3DX->CreateTextureFromFile() to load the texture.
And Sprite->Draw() to draw it on the screen, but when I do, the sprite is little bigger than the original size.

Share this post


Link to post
Share on other sites
Toyemann    122
I''ve figured it out. Thanks for the response, though.

After a long painful debugging:
I''ve noticed that a sprite has to be in a certain size.
The width and the height have to be in the scale of 2.
(eg 2,4,8,16,32,64,128,256,etc.)
Any other size is stratched to fit the next size up.
That''s why my sprites were showing bigger than it should.

How come no one tells me this stuff!!!! Ergg!!!

Heheh, have a nice day.

Share this post


Link to post
Share on other sites