• Advertisement

Archived

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

Question about D3DXSprite

This topic is 5883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For the Draw method, where do you specify the dest rect? I''m guessing it''s pTranslation, but I''m not sure. The docs really suck for this interface. This is the definition for pTranslation; "Pointer to a D3DXVECTOR2 structure, representing the translation. If this argument is NULL, it is treated as identity"

Share this post


Link to post
Share on other sites
Advertisement
It is the position of the top left hand corner of the sprite relative to the top left hand corner of the window (or screen if in full screen mode).

Share this post


Link to post
Share on other sites
I understand that, but how do I move the sprite around the screen? Let''s say I want to place a texture at position 100,100 of the screen, how would I do that using the Draw method?

Share this post


Link to post
Share on other sites
D3DXVECTOR2 pTranslation;
pTranslation.x = 100;
pTranslation.y = 100;
sprite->Draw( ....... pTranslation...);
pTranslation should be the 6th parameter .
hope this helps..

Share this post


Link to post
Share on other sites
Yup! That''s what I was looking for. As soon as I get home from work I''ll give it a try. It sucks not being able to test this stuff out at work.

Thanks

Share this post


Link to post
Share on other sites

  • Advertisement