I wrote up the dbSetSpritePriority bug. Though now i am not sure if it is a actual bug or a just a misuse of code.
I have attached a zip file with the entire project showing the bug. I found that it works fine with DbSprite but not with dbPasteSprite. So simply change the dbPasteSprite to dbSprites and the program will work as intended.
If i do not understand the command properly and it is not a bug then sorry for the trouble. But this may be what users are having problems with. I have found in my code i need to use the dbPasteSprite and not just the dbSprite so i would love for the functionality to still work. You can semi fix it by hiding and then showing the sprite.
The project has all media required.
Project: http://www.freemmorpgmaker.com/Sprite-Priority-Bug.zip
Code:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbDisableEscapeKey ( );
dbRandomize ( dbTimer ( ) );
// Load Some Sprites
dbCreateAnimatedSprite(1,"1.png",1,1,1);
dbCreateAnimatedSprite(2,"2.png",1,1,2);
dbCreateAnimatedSprite(3,"3.png",1,1,3);
dbCreateAnimatedSprite(4,"4.png",1,1,4);
dbCreateAnimatedSprite(5,"5.png",1,1,5);
while ( LoopGDK ( ) )
{
dbText(25,200,"When you press the left Key the sprite priority will randomly change. ");
dbText(25,225,"Notice the images still overlap the same. ");
dbPasteSprite ( 1, 25, 25 );
dbPasteSprite ( 2, 100, 25);
dbPasteSprite ( 3, 175, 25);
dbPasteSprite ( 4, 250, 25);
dbPasteSprite ( 5, 325, 25);
if(dbLeftKey() == 1)
{
dbSetSpritePriority ( 1, dbRnd(5) ) ;
dbSetSpritePriority ( 2, dbRnd(5) ) ;
dbSetSpritePriority ( 3, dbRnd(5) ) ;
dbSetSpritePriority ( 4, dbRnd(5) ) ;
dbSetSpritePriority ( 5, dbRnd(5) ) ;
}
// Exit if You press Escape
if ( dbEscapeKey ( ) )
break;
dbSync ( );
}
return;
}
Screenshot:
Here is the media if you do not wish to download the complete project.
Your signature has been erased by a mod - Please reduce it to 600x120 maximum size