Skip to main content
GameDev.net gamedev.net
🔒 Locked

sprites

Started by 31337noob Mar 20, 2005 at 2:12 PM 2 replies 500+ views
Original Post
31337noob
31337noob
i am using LPD3DXSPRITE. when i display the sprite, i think the sprite is not the real size of the bitmap. it looks like depends on what the window size is that changes the bitmap size. so my question is how so i make the sprite the actual size of the bitmap? please help me. thanks in advanced
31337noob
31337noob
Quote:
Original post by adriano_usp
Maybe this thread could help you.


thanks that helped me alot.

i have another problem though.

i have a bomb that displays the time remaining. it works expect for when it displays the same number. first of all, the time remaining is using two sprites that means it is only two digits. it starts at 60 then counts down. and here is the problem. lets say the time hits 55. only one 5 shows then it goes to 54 which both of them shows. it only does that when there is a same digit.arrg.

please help me.

thanks in advanced.
adriano_usp
adriano_usp
Quote:
have a bomb that displays the time remaining. it works expect for when it displays the same number. first of all, the time remaining is using two sprites that means it is only two digits. it starts at 60 then counts down. and here is the problem. lets say the time hits 55. only one 5 shows then it goes to 54 which both of them shows. it only does that when there is a same digit.arrg.

I suppose that you have one texture (bitmap) containing the numbers (0,1,...,9), correct?
You could only use one sprite for that, calling the ID3DXSprite::Draw method twice (once for each number). That is, you could do something like this:

pSprite->Draw( ppTexture,
&srcRectForFirstNumber,
NULL,
NULL,
0.0f,
&D3DXVECTOR2(100,100), // just an example to position the first number
0xFFFFFFFF );

pSprite->Draw( ppTexture,
&srcRectForSecondNumber,
NULL,
NULL,
0.0f,
&D3DXVECTOR2(200,100), // just an example to position the second number
0xFFFFFFFF );

Well, the ID3DXSprite::Draw's syntax shown above is from the first DX9 version (C++). This method can have a different syntax on the newer DX versions.

Topic Locked

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

Sign in to reply to this topic.