What are sprites? How sprites are used to create an animation?
A Sprite is a bitmap that is displayed on the screen that is often moving around (like a cartoon character). Animated sprites are a sequence of bitmaps that when rendered with a delay between each frame gives an animation. In the example application "Sprite.Zip" we have just read the cursorposition and drawn a rotating MousePtr Sprite their!A typical Sprite Structure :-
typedef struct SPRITE
{
LPDIRECTDRAWSURFACE7 Surf;
int nFrames;
int iCurFrame;
int MaxFrameDelay,int CurFrameDelay;
int Width, Height;
}SPRITE;
This SPRITE struct specifies that we need a DirectDrawSurface to hold the Bitmap (Containing the sequence of frames drawn one after another), Number of frames, The Current Frame, The MaximumDelay of a Frame, the Current Frame Delay, and the width and height of the SpriteBitmap
We have to set the Sprite by "SetSprite" functioncall with the necessary structre intialization elements, Draw the Sprite by DrawSprite function call that selects the current frame and draws it(The Frame Drawn will Depend on the time elapsed since the App started)
FAQ Menu
Sponsored links
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
Add complete SSH and SFTP support to your .NET framework application
3 Months Free - ASP.NET Web Hosting
3 Months Free & No Setup Fees on ASP.NET 3.5/2.0 Hosting on Windows 2008/2003 Servers ? Click Here!
3 Months Free & No Setup Fees on ASP.NET 3.5/2.0 Hosting on Windows 2008/2003 Servers ? Click Here!
PureCM Software Configuration Management
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Virtual File System SDK
Create your own file systems in Windows and .NET applications
Create your own file systems in Windows and .NET applications
CSTSOFT Instrumentation .NET & ActiveX Components
A collection of 13 instrumentation .NET/ActiveX/VCL components including Gauge,Knob,LED,Trend etc.
A collection of 13 instrumentation .NET/ActiveX/VCL components including Gauge,Knob,LED,Trend etc.
