Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Utils.ScreenshotCreator Class Reference

Create screenshots of the render window. More...

Inheritance diagram for Dragengine.Utils.ScreenshotCreator:

Public Member Functions

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

Public Attributes

CaptureCanvas pCaptureCanvas
 Capture canvas for render window.
bool pCapturePending
 Capture pending.
Console pConsole
 Console to log finished screenshots to or null to not use.
int pNextNumber
String pPath
 Directory to store screenshots into including path delimiter.
String pPrefix
 File name prefix.
String pSuffix
 File name suffix including file pattern.

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.

Member Function Documentation

◆ dispose()

void Dragengine.Utils.ScreenshotCreator.dispose ( )

Dispose of held resources.

Call this before exiting your game for proper cleaning up.

References pCaptureCanvas.

Referenced by getPath().

◆ getConsole()

Console Dragengine.Utils.ScreenshotCreator.getConsole ( )

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

References getPrefix(), and pPrefix.

Referenced by screenshotFinished().

◆ getPath()

String Dragengine.Utils.ScreenshotCreator.getPath ( )

Directory to store screenshots into including path delimiter.

References dispose(), pCaptureCanvas, and pConsole.

Referenced by setPath().

◆ getPrefix()

String Dragengine.Utils.ScreenshotCreator.getPrefix ( )

File name prefix.

Used filename will be

<prefix>date-time<suffix>

.

References pPath.

Referenced by getConsole().

◆ getSuffix()

String Dragengine.Utils.ScreenshotCreator.getSuffix ( )

File name suffix including file pattern.

Used filename will be

<prefix>date-time<suffix>

.

References pPath.

Referenced by takeScreenshot().

◆ new()

ScreenshotCreator Dragengine.Utils.ScreenshotCreator.new ( )

Create screenshot creator.

Default values are:

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

References new(), pNextNumber, pPath, pPrefix, and pSuffix.

Referenced by new().

◆ screenshotFinished()

void Dragengine.Utils.ScreenshotCreator.screenshotFinished ( String filename)

Screenshot finished.

Default implementation logs to the console if not null.

References getConsole(), pCaptureCanvas, pCapturePending, pConsole, pNextNumber, pPath, pPrefix, pSuffix, screenshotFinished(), setConsole(), setSuffix(), takeScreenshot(), and update().

Referenced by screenshotFinished().

◆ setConsole()

void Dragengine.Utils.ScreenshotCreator.setConsole ( Console console)

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

References setPrefix().

Referenced by screenshotFinished().

◆ setPath()

void Dragengine.Utils.ScreenshotCreator.setPath ( String path)

Set directory to store screenshots into.

A trailing path separator will be added if missing.

References getPath().

Referenced by setPrefix().

◆ setPrefix()

void Dragengine.Utils.ScreenshotCreator.setPrefix ( String prefix)

Set file name prefix.

Used filename will be

<prefix>date-time<suffix>

.

References setPath().

Referenced by setConsole().

◆ setSuffix()

void Dragengine.Utils.ScreenshotCreator.setSuffix ( String suffix)

Set file name suffix including file pattern.

Used filename will be

<prefix>date-time<suffix>

.

Referenced by screenshotFinished().

◆ takeScreenshot()

void Dragengine.Utils.ScreenshotCreator.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.

References getSuffix(), and pSuffix.

Referenced by screenshotFinished().

◆ update()

void Dragengine.Utils.ScreenshotCreator.update ( )

Update screenshot maker.

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

References pPrefix.

Referenced by screenshotFinished().

Member Data Documentation

◆ pCaptureCanvas

CaptureCanvas Dragengine.Utils.ScreenshotCreator.pCaptureCanvas

Capture canvas for render window.

Referenced by dispose(), getPath(), and screenshotFinished().

◆ pCapturePending

bool Dragengine.Utils.ScreenshotCreator.pCapturePending

Capture pending.

Referenced by screenshotFinished().

◆ pConsole

Console Dragengine.Utils.ScreenshotCreator.pConsole

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

Referenced by getPath(), and screenshotFinished().

◆ pNextNumber

int Dragengine.Utils.ScreenshotCreator.pNextNumber

Referenced by new(), and screenshotFinished().

◆ pPath

String Dragengine.Utils.ScreenshotCreator.pPath

Directory to store screenshots into including path delimiter.

Referenced by getPrefix(), getSuffix(), new(), and screenshotFinished().

◆ pPrefix

String Dragengine.Utils.ScreenshotCreator.pPrefix

File name prefix.

Used filename will be

<prefix>date-time<suffix>

.

Referenced by getConsole(), new(), screenshotFinished(), and update().

◆ pSuffix

String Dragengine.Utils.ScreenshotCreator.pSuffix

File name suffix including file pattern.

Used filename will be

<prefix>date-time<suffix>

.

Referenced by new(), screenshotFinished(), and takeScreenshot().


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