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

DrawSurface

(Formerly known as RawDrawFrameTransparent, which is now obsolete)
(Formerly known as RawRestoreScreen, which is now obsolete)

DrawingSurface.DrawSurface(DrawingSurface *source, optional int transparency)
Draws the specified surface on top of this surface, optionally using transparency percent transparency.

This allows you to perform day-to-night fading and other special effects.

NOTE: You cannot use the transparency parameter with 256-colour surfaces.

NOTE: This command can be a bit on the slow side, so don't call it from repeatedly_execute.

TIP: If you want to gradually fade in a second background, create a copy of the original surface and then restore it after each iteration, otherwise the backgrounds will converge too quickly.

Example:

DrawingSurface *mainBackground = Room.GetDrawingSurfaceForBackground(0);
DrawingSurface *nightBackground = Room.GetDrawingSurfaceForBackground(1);
mainBackground.DrawSurface(nightBackground, 50);
mainBackground.Release();
nightBackground.Release();
this will draw background frame 1 onto frame 0 at 50% opacity.

See Also: DrawingSurface.DrawImage, SetAmbientTint


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