Using screenshots in games saves.

Started by Lufia, Fri 09/10/2009 22:40:07

Previous topic - Next topic

Lufia

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 :

Code: ags
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.

Khris

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.

Lufia

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.

Pumaman

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.

SMF spam blocked by CleanTalk