Sign in to follow this  

Sprites & Screen movement

This topic is 4714 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

I have a sprite loaded on screen and I want the screen to move with the sprite so that, when a map is placed behind the sprite, it can traverse the map, but the screen will always be focused on the sprite. Any device matrix transforms I do seem to be being ignored. I have no matrix setup functions but the screen automatically looks at the sprite, presumably due to the use of LP3DXSPRITE. I'm confused as to why i cant get the screen to move. I hope i have explained this ok. Ols

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There are many ways to transform a sprite, but by default they are drawn in screen space and the world/view/projection matricies are ignored.

You probably want to use either the poistion vector passed to Draw() or the SetTransform() method to move a sprite around in screen space.

If you really want to draw the sprite in world space: pass the D3DXSPRITE_OBJECTSPACE flag to begin. Be aware that the world transform is applied when you call End() or Flush() and not between each call to Draw(). SetTransform() on the other hand works between calls to Draw().

hope this helps.

Share this post


Link to post
Share on other sites

This topic is 4714 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this