Question about D3DXSprite

Started by
3 comments, last by Poisler 22 years, 3 months ago
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"
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).
HenryLecturer in Computer Games TechnologyUniversity of Abertay DundeeScotlandUK
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?
D3DXVECTOR2 pTranslation;
pTranslation.x = 100;
pTranslation.y = 100;
sprite->Draw( ....... pTranslation...);
pTranslation should be the 6th parameter .
hope this helps..
http://uae-arts.host.sk
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

This topic is closed to new replies.

Advertisement