Hi
I'm using VC++ 2008 and Dark GDK for some simple 2D animation.
I have a simple question.
My sprite is meant to talk as in the only difference between frames is the mouth opens and closes and the eyes blink. But when I run the code the sprite moves across the frame instead of standing in one place with just the mouth moving. The animation is clean and good without flicker but I don't want the sprite to slide across the frame. As it dissapears out the right side the next frame is already coming in the left.
Is this because I somehow don't have my sprites exactly positioned right in the *.jpg? I spent a whole day drawing a graph and exactly positioning the sprites the same distance apart. The only thing I'm unsure of is how does the GDK know where the exact centre of the first sprite should be anyway?
Here is the code:
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbDisableEscapeKey ( );
dbCreateAnimatedSprite ( 1, "animate7.jpg", 8, 2, 1 );
while ( LoopGDK ( ) )
{
{
dbPasteSprite ( 1, 0, 0 );
dbPlaySprite ( 1, 1, 16, 100 );
}
if ( dbEscapeKey ( ) )
break;
dbSync ( );
}
// delete all the sprites
for ( int i = 1; i < 30; i++ )
dbDeleteSprite ( i );
return;
}
As you can see it's nothing but the basic skeleton of the "Hello World" code but using my own sprite. Is there a tutorial anywhere on how the animation *.jpg file should be set up exactly? I just presumed that every frame must be EXACTLY the same distance from the last? And how many frames can be in a file? Is a *.jpg better than a *.bmp? etc
thanx
m0ng00se