When I initially call dbSpriteScaleX, the function returns the sprite width, rather than the scale. After setting the scale to 100 with dbScaleSprite, the function does return the actual scale (100). Is this a bug, or am I missing something?
See for instance the code below:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbDisableEscapeKey ( );
dbRandomize ( dbTimer ( ) );
dbSetImageColorKey ( 255, 0, 255 );
dbCreateAnimatedSprite ( 1, "sprite.bmp", 4, 4, 1 );
dbSprite ( 1, 10, 10, 1 );
while ( LoopGDK ( ) )
{
if ( dbEscapeKey ( ) )
break;
if ( dbLeftKey ( ) )
dbScaleSprite(1, 100.0f );
dbText ( 200, 200, dbStr( dbSpriteScaleX( 1 ) ) );
dbSync ( );
}
dbDeleteSprite ( 1 );
dbDeleteImage ( 1 );
return;
}
at first, the width of the sprite is shown (128). But after pressing the left key, the scale is set to 100 and the actual scale (100) is returned correctly.
Thanks in advance for your help!