Drag[en]gine Script Module DragonScript Script API  1.0
ScreenshotCreator Class Reference

Create screenshots of the render window. More...

Inheritance diagram for ScreenshotCreator:

Public Member Functions

void dispose ()
 Dispose of held resources. More...
 
Console getConsole ()
 Console to log finished screenshots to or null to not use. More...
 
String getPath ()
 Directory to store screenshots into including path delimiter. More...
 
String getPrefix ()
 File name prefix. More...
 
String getSuffix ()
 File name suffix including file pattern. More...
 
ScreenshotCreator new ()
 Create screenshot creator. More...
 
void screenshotFinished (String filename)
 Screenshot finished. More...
 
void setConsole (Console console)
 Set console to log finished screenshots to or null to not use. More...
 
void setPath (String path)
 Set directory to store screenshots into. More...
 
void setPrefix (String prefix)
 Set file name prefix. More...
 
void setSuffix (String suffix)
 Set file name suffix including file pattern. More...
 
void takeScreenshot ()
 Take a screenshot. More...
 
void update ()
 Update screenshot maker. More...
 

Detailed Description

Create screenshots of the render window.

This class takes care of creating screenshots using CaptureCanvas handling the entire process from triggering a capture to storing the file on disk easily. Call the update method during your game update loop for this class to work.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ dispose()

void dispose ( )

Dispose of held resources.

Call this before exiting your game for proper cleaning up.

§ getConsole()

Console getConsole ( )

Console to log finished screenshots to or null to not use.

§ getPath()

String getPath ( )

Directory to store screenshots into including path delimiter.

§ getPrefix()

String getPrefix ( )

File name prefix.

Used filename will be

<prefix>date-time<suffix>

.

§ getSuffix()

String getSuffix ( )

File name suffix including file pattern.

Used filename will be

<prefix>date-time<suffix>

.

§ new()

Create screenshot creator.

Default values are:

  • pPath: '/capture/'
  • prefix: 'screenshot-'
  • suffix: '.png'.

§ screenshotFinished()

void screenshotFinished ( String  filename)

Screenshot finished.

Default implementation logs to the console if not null.

§ setConsole()

void setConsole ( Console  console)

Set console to log finished screenshots to or null to not use.

§ setPath()

void setPath ( String  path)

Set directory to store screenshots into.

A trailing path separator will be added if missing.

§ setPrefix()

void setPrefix ( String  prefix)

Set file name prefix.

Used filename will be

<prefix>date-time<suffix>

.

§ setSuffix()

void setSuffix ( String  suffix)

Set file name suffix including file pattern.

Used filename will be

<prefix>date-time<suffix>

.

§ takeScreenshot()

void takeScreenshot ( )

Take a screenshot.

The screenshot will be taken during the GraphicSystem.renderWindows(). Once finished it will be saved. If a console is set the finished screenshot is logged to the console. Only one screenshot request can be active at the same time. If a request is still pending the request is ignored.

§ update()

void update ( )

Update screenshot maker.

Call this during your game loop. Best is to call it towards the end.


The documentation for this class was generated from the following file: