Skip to main content
gamedev.net
🔒 Locked

Sprites problem

Started by Tosh777 Mar 30, 2011 at 10:25 AM 9 replies 1k views
Original Post
Tosh777
Tosh777
Hello. I started my own gui system and got some problems with rendering the images and their sizes.

I use dds format. When drawn in photoshop it looks perfect. For export i use nvidia dds plug-in and ABGR 128 bpp | floating point when exporting.

The problem is when rendered in my game it looks bigger which i seems cant control.
Here is the image when rendered in the game:
rendered

and the dds when opened in the dds viewer:
dds


Is this something from my code or from the image?
Tosh777
Tosh777
Nobody encountered this problem?
Evil Steve
Evil Steve
Is your backbuffer the same size as your client area? Are you using ID3DXSprite to draw the sprite?

You could always wait more than an hour and 20 minutes before bumping your post too
Tosh777
Tosh777
Yes it is the same size. Yes i use ID3DXSprite.
Here is my render function if it will be in any help:


obj.sprite->Begin(D3DXSPRITE_ALPHABLEND);

obj.sprite->Draw(obj.normalText,NULL,NULL,&obj.imagePosition,D3DXCOLOR(255,255,255,255));

obj.sprite->End();

Erik Rufelt
Erik Rufelt
Can't see any difference in your images, which seem resized. Post 100% size images.
Molle85
Molle85
if you've changed the transform of the sprite object somewhere else in your project you need to load an identity matrix.
check D3DXSprite->SetTransform()
Molle85
Molle85
this may also be the result of the texture not being power of 2
Tosh777
Tosh777
ok i attached png version of the image which also look stretched in width when rendered, but if you open it with viewer looks ok.
Tosh777
Tosh777

if you've changed the transform of the sprite object somewhere else in your project you need to load an identity matrix.
check D3DXSprite->SetTransform()



Didnt work. Also i never change the transform.
And yes the texture dimensions are at power of 2.

Molle85
Molle85
164 x 56 doesn't look very power of 2
Tosh777
Tosh777
omgomg i am super noob. I changed the dimensions to be power of 2 and now works. I guess i missunderstood you second post molle.. Thank you all for the help.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.