Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Atelier on Mon 30/11/2009 13:32:28

Title: Screenshot and Save
Post by: Atelier on Mon 30/11/2009 13:32:28
I'm working on a one room game at the moment where the player can choose some decorations to place upon a Christmas tree. I have a couple of problems though:

- First off, I have a rough idea of how the decorations will be placed. At the bottom of the screen will be a tray with different varieties of baubles, which the player drags out of the box and places them upon the tree. But how can I code this?

- Secondly, after the player has clicked on the finish button, how do I screenshot their decorated tree and save it as a picture file. (In the game folder, but ideally on their desktop).

Thanks for any help in advance.
Title: Re: Screenshot and Save
Post by: Matti on Mon 30/11/2009 14:19:17
1. The forum search brings up several threads about drag and drop programming. You should take a look at these.

2. SaveScreenShot (string filename) is what you're looking for.
Title: Re: Screenshot and Save
Post by: Khris on Mon 30/11/2009 17:11:23
Or DynamicSprite.SaveToFile(), in case you want to crop the screenshot first.
Title: Re: Screenshot and Save
Post by: Atelier on Mon 30/11/2009 21:16:17
Thanks Matti and Muc! I haven't had a chance to try anything yet, but I read through some object dragging and dropping threads so I think I know what needs to be done now. I'll edit soon with details on whether it worked.