spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * DrawingSurface functions and properties

CreateCopy

(Formerly known as RawSaveScreen, which is now obsolete)

DrawingSurface* DrawingSurface.CreateCopy()
Makes a backup copy of the current surface, in order that it can be restored later. This could be useful to back up a background scene before writing over it, or to save a certain state of your drawing to restore later.

Unlike the obsolete RawSaveScreen command in previous versions of AGS, backup surfaces created with this command are not lost when the player changes room or restores a game. However, surfaces containing a copy of room backgrounds can be very large, using up a large amount of memory and can increase the save game sizes significantly. Therefore, it is strongly recommended that you Release any backup copy surfaces as soon as you are done with them.

Example:

DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
DrawingSurface *backup = surface.CreateCopy();
surface.DrawTriangle(0,0,160,100,0,200);
Wait(80);
surface.DrawSurface(backup);
backup.Release();
surface.Release();
will save a copy of the room background, draw a triangle onto it, wait for a while and then restore the original background.

See Also: DrawingSurface.DrawSurface


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.