Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: OllyRich on Mon 30/05/2005 16:42:26

Title: Problem getting screenshot
Post by: OllyRich on Mon 30/05/2005 16:42:26
Hello,

The following code should save a game position then load the
corresponding screenshot to the button  "currentPic" in the save dialog
"gMysaveguia". The problem is that it always load the previous saved screenshot
and not the current one. Does anybody have any ideas?
if (keycode==363){
   
     theSlot=150;
     
      SaveGameSlot(theSlot, "preview");
      Wait(200);
     
      buttonSprite3 = DynamicSprite.CreateFromSaveGame(150,80, 55);
      currentPic.NormalGraphic =  buttonSprite3.Graphic;
     
    showButtonImages();   //Vorbereitungsphase
    SetMouseCursor (6);
 
   gMysaveguia.Visible = true;
      

  }

Thanks
Title: Re: Problem getting screenshot
Post by: strazer on Mon 30/05/2005 19:01:30
SaveGameSlot is a delayed-response function, meaning it gets executed when the script finishes, so it is actually executed after you create the dynamic sprite.

You could use DynamicSprite.CreateFromScreenShot instead.