Jump to content
  • Advertisement
Sign in to follow this  
ols

Sprites & Screen movement

This topic is 5026 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!