With the following :
#include "DarkSDK.h"
int zoneclicked(int but,int x1,int y1,int x2,int y2);
void DarkSDK(void)
{
register int full,debug,Stat_y,go,click,stats;
dbRandomize(dbTimer());
dbSyncOn();
dbSyncRate(60);
dbAutoCamOff();
dbBackdropOn();
dbColorBackdrop(0);
dbFogOn();
dbFogDistance(500);
dbFogColor(0);
dbSetCameraView(0,0,1,1);
dbSetTextFont("Tahoma");
dbSetTextSize(11);
dbLoadImage("datas\start.png",1,1);
dbLoadImage("datas\point.png",2,1);
//dbSprite(1,229,298,2);
dbSprite(2,468,298,2);
//dbHideSprite(1);
dbHideSprite(2);
full=1;
debug=0;
Stat_y=40;
go=0;
click=0;
while (LoopSDK() && go==0)
{
if (dbEscapeKey())
{
return;
}
dbCLS(0);
/* if (dbMouseClick()==0)
{
click=0;
}
if (click==0)
{
// Fullscreen button
if (zoneclicked(1,244,294,244+102,294+16)==1)
{
if (full==1)
{
full=0;
dbHideSprite(1);
}
else
{
full=1;
dbShowSprite(1);
}
click=1;
}
if (zoneclicked(2,482,294,482+107,294+16)==1)
{
if (stats==0)
{
stats=1;
dbShowSprite(2);
}
else
{
stats=0;
dbHideSprite(2);
}
click=1;
}
// Launch
if (zoneclicked(1,306,330,306+96,330+28)==1)
{
go=1;
}
// Exit
if (zoneclicked(1,423,330,423+65,330+28)==1)
{
return;
}
}
*/
// dbPasteImage(1,0,200,0);
if (dbSpriteVisible(2)) dbText(0,0,"Y");
dbSync();
}
}
int zoneclicked(int but,int x1,int y1,int x2,int y2)
{
if ((dbMouseX()>x1 && dbMouseX()<x2) &&
(dbMouseY()>y1 && dbMouseY()<y2) &&
dbMouseClick()==1)
{
return (1);
}
return (0);
}
Sprite 2 should be invisible (hidden). Unfortunately it appears in the display loop for some reason. Has anyone else had the same trouble ?
One other very important point : When the escape key is pressed and the program 'exits' - it doesn't (left running in the list of processes). However, with dbHideSprite removed, its okay when the program exits.
I'm using VS .Net 2003...
Walk softly... and carry a big gun...