Drag[en]gine Script Module DragonScript  1.21
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. 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.

Member Function Documentation

◆ dispose()

void Dragengine.Utils.ScreenshotCreator.dispose ( )

Dispose of held resources.

Call this before exiting your game for proper cleaning up.

◆ getConsole()

Console Dragengine.Utils.ScreenshotCreator.getConsole ( )

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

◆ getPath()

String Dragengine.Utils.ScreenshotCreator.getPath ( )

Directory to store screenshots into including path delimiter.

◆ getPrefix()

String Dragengine.Utils.ScreenshotCreator.getPrefix ( )

File name prefix.

Used filename will be

<prefix>date-time<suffix>

.

◆ getSuffix()

String Dragengine.Utils.ScreenshotCreator.getSuffix ( )

File name suffix including file pattern.

Used filename will be

<prefix>date-time<suffix>

.

◆ new()

ScreenshotCreator Dragengine.Utils.ScreenshotCreator.new ( )

Create screenshot creator.

Default values are:

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

◆ screenshotFinished()

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

Screenshot finished.

Default implementation logs to the console if not null.

◆ setConsole()

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

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

◆ setPath()

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

Set directory to store screenshots into.

A trailing path separator will be added if missing.

◆ setPrefix()

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

Set file name prefix.

Used filename will be

<prefix>date-time<suffix>

.

◆ setSuffix()

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

Set file name suffix including file pattern.

Used filename will be

<prefix>date-time<suffix>

.

◆ 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.

◆ update()

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