Difference between revisions of "Global Command: createScreenshot"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed tbl-ds"> <span class="bold">Command History</span> <div class="mw-collapsible-content"> <div class="alt-bg">Available since ...")
 
Line 15: Line 15:
  
  
Example 1: basic save screenshot to x folder! (if a file with the same name exists: it will be automatically overwritten!)
+
Example 1: basic save screenshot to x folder (if a file with the same name exists: it will be automatically overwritten)
 
<syntaxhighlight>
 
<syntaxhighlight>
-- save to "screenshots" folder as "filename.png"!
+
-- save to "screenshots" folder as "filename.png"
 
createScreenshot("screenshots/filename.png")
 
createScreenshot("screenshots/filename.png")
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Example 2: save screenshot to x folder with both file name + time stamp!
+
Example 2: save screenshot to x folder with both file name + time stamp
 
<syntaxhighlight>
 
<syntaxhighlight>
-- add this as an execute script action inside of a key input; change "filename to whatever you like!
+
-- add this as an execute script action inside of a key input; change "filename to whatever you like
  
-- save to "screenshots" folder as "filename_(date)_(time).png"!
+
-- save to "screenshots" folder as "filename_(date)_(time).png"
 
local time = os.date("%Y-%m-%d_%Hh-%Mm-%Ss")
 
local time = os.date("%Y-%m-%d_%Hh-%Mm-%Ss")
 
createScreenshot("screenshots/filename_" .. time .. ".png")
 
createScreenshot("screenshots/filename_" .. time .. ".png")
 
</syntaxhighlight>  
 
</syntaxhighlight>  
  
Example 3: save screenshot to x folder with time stamp only!
+
Example 3: save screenshot to x folder with time stamp only
 
<syntaxhighlight>
 
<syntaxhighlight>
-- add this as an execute script action inside of a key input!
+
-- add this as an execute script action inside of a key input
  
-- save to "screenshots" folder as "(date)_(time).png"!
+
-- save to "screenshots" folder as "(date)_(time).png"
 
local time = os.date("%Y-%m-%d_%Hh-%Mm-%Ss")
 
local time = os.date("%Y-%m-%d_%Hh-%Mm-%Ss")
 
createScreenshot("screenshots/" .. time .. ".png")
 
createScreenshot("screenshots/" .. time .. ".png")
Line 50: Line 50:
  
 
<span class="bold">clr/clear</span>: bool <br/>
 
<span class="bold">clr/clear</span>: bool <br/>
If true the screenshot will be cleared. Default value is false. If the screenshot is cleared it will be generated automatically by the engine again, everytime the scene is changed from a playable scene to a menu.  
+
If true the screenshot will be cleared. Default value is false. If the screenshot is cleared it will be generated automatically by the engine again, every time the scene is changed from a playable scene to a menu.  
  
  

Revision as of 19:20, 19 March 2014

Command History

Available since v3.7


A user can create a screenshot to be used for the next save game or to save into an external folder as a .png file.


Syntax:

createScreenshot("filename", {flags=1, clear})


Example 1: basic save screenshot to x folder (if a file with the same name exists: it will be automatically overwritten)

-- save to "screenshots" folder as "filename.png"
createScreenshot("screenshots/filename.png")

Example 2: save screenshot to x folder with both file name + time stamp

-- add this as an execute script action inside of a key input; change "filename to whatever you like

-- save to "screenshots" folder as "filename_(date)_(time).png"
local time = os.date("%Y-%m-%d_%Hh-%Mm-%Ss")
createScreenshot("screenshots/filename_" .. time .. ".png")

Example 3: save screenshot to x folder with time stamp only

-- add this as an execute script action inside of a key input

-- save to "screenshots" folder as "(date)_(time).png"
local time = os.date("%Y-%m-%d_%Hh-%Mm-%Ss")
createScreenshot("screenshots/" .. time .. ".png")


Arguments

filename: "string"
If specified the screenshot will be saved to the given path. Otherwise the screenshot will be used for the next savegame(s), as long as a new screenshot is created or the current screenshot is cleared. If a screenshot for a savegame was created before it will be overwritten by the new screenshot.


Flags

clr/clear: bool
If true the screenshot will be cleared. Default value is false. If the screenshot is cleared it will be generated automatically by the engine again, every time the scene is changed from a playable scene to a menu.


Return

none