Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Lufia on Fri 09/10/2009 22:40:07

Title: Using screenshots in games saves.
Post by: Lufia on Fri 09/10/2009 22:40:07
I'd like to have a save GUI consisting of four slots represented by the screenshots of the respective saves. For that, I call this function upon loading the GUI :

function show_save_game_dialog() {
  gSaveGame.Centre();
  gSaveGame.Visible = true;
  int i = 1;
 
  while (i <= 4) {
    screenshot[i-1] = DynamicSprite.CreateFromSaveGame(i, 128, 96);
    GUIControl *control = gSaveGame.Controls[i];
    if (screenshot[i-1] != null) {
      control.AsButton.NormalGraphic = screenshot[i-1].Graphic;
    }
    i++;
  }
  mouse.UseModeGraphic(eModePointer);
  gInventory.Visible = false;
}


screenshot is defined by DynamicSprite* screenshot[4];

When I run this, the place where the screenshots should be is transparent : I can see the background of the room. The game is properly saved in each slot and I can restore them without problem.

Any suggestion is welcome.
Title: Re: Using screenshots in games saves.
Post by: Khris on Sat 10/10/2009 09:47:58
Just a thought:

Quote from: manualIn order for this to work, the "Save screenshots in save games" option must be ticked in the main Game Settings pane.
Title: Re: Using screenshots in games saves.
Post by: Lufia on Sat 10/10/2009 13:12:22
That's set to true.

Actually, after more testing, I've found the cause. I had to import the background image for the GUI without using its alpha channel. It's odd that this would have an incidence as I don't have any transparent pixels on this particular image. If anybody has any info on how that works...

Well, at least everything works as it should now.

Thanks for your time, Khris.
Title: Re: Using screenshots in games saves.
Post by: Pumaman on Wed 14/10/2009 22:33:02
This is a bug in AGS, where save game screenshots won't appear on a GUI that has an alpha channel, if you use the AdditiveOpacity GUI Alpha Style.

It will be fixed in the next version of AGS.