Jump to content
  • Advertisement
Sign in to follow this  
Makoy

Sprite animation, blitting etc.

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

Advertisement
Assuming you're using D3DXSprite, what you want to do is change the values passed by pSrcRect (the second parameter) when you call the Draw method. It specifies which area of the texture (the first parameter) to display.

Just put all your 'frames' for the animation in one texture, and then change frames by changing areas.

There's a tutorial out there somewhere. I'll see if I can find it if you're interested.

Share this post


Link to post
Share on other sites
Quote:
Assuming you're using D3DXSprite, what you want to do is change the values passed by pSrcRect (the second parameter) when you call the Draw method. It specifies which area of the texture (the first parameter) to display.

Just put all your 'frames' for the animation in one texture, and then change frames by changing areas.

There's a tutorial out there somewhere. I'll see if I can find it if you're interested.


yes I'm very much interested. Could you please let me check the link? I'm not yet familiar with the "pSrcRect" thing.

Edit: Fixed quote tag

[Edited by - Coder on November 15, 2004 2:38:37 AM]

Share this post


Link to post
Share on other sites
Keith Ditchburn has a good site, I've referred people to this site quite often. Here is a link for you on sprites :

http://www.toymaker.info/Games/html/sprites.html

Hope this helps you.

Steve

Share this post


Link to post
Share on other sites
yeah but some of the codes in codesampler doesn't compile on my vc++ :(

here's the error I got when I compiled the dx9_d3dxsprite:
dx9_d3dxsprite.cpp
c:\downloads\game\dx9_d3dxsprite\dx9_d3dxsprite\dx9_d3dxsprite.cpp(359) : error C2065: 'D3DXSPRITE_ALPHABLEND' : undeclared identifier
c:\downloads\game\dx9_d3dxsprite\dx9_d3dxsprite\dx9_d3dxsprite.cpp(365) : error C2660: 'Draw' : function does not take 5 parameters
Error executing cl.exe.

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!