Difference between revisions of "CreateScreenshot"
Line 6: | Line 6: | ||
− | 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. | + | A user can create a screenshot to be used for the next save game or to save into an external folder as a .png/jpg file. |
− | |||
Syntax: | Syntax: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | createScreenshot( | + | createScreenshot("filename", {flags=1, clear=true|false}) |
</syntaxhighlight> | </syntaxhighlight> | ||
− | Example: | + | Example 1: basic save screenshot to x folder! |
<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 & include time stamp! | ||
+ | <syntaxhighlight> | ||
+ | function exportScreenshot() | ||
+ | local time = os.date("%D-%M-%Y_%H-%M-%S") | ||
+ | createScreenshot("screenshots/filename_" .. time .. ".png") | ||
+ | </syntaxhighlight> | ||
Line 26: | Line 32: | ||
<b><u>Arguments</u></b> | <b><u>Arguments</u></b> | ||
− | + | <b>filename</b>: "string" <br/> | |
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. | 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 | + | |
+ | <b><u>Flags</u></b> | ||
+ | |||
+ | <b>clr/clear</b> <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, everytime the scene is changed from a playable scene to a menu. | ||
− | Return | + | |
+ | <b><u>Return</u></b> | ||
+ | |||
+ | none | ||
{{i18n|CreateScreenshot}} | {{i18n|CreateScreenshot}} |
Revision as of 19:00, 10 March 2013
Command History
A user can create a screenshot to be used for the next save game or to save into an external folder as a .png/jpg file.
Syntax:
createScreenshot("filename", {flags=1, clear=true|false})
Example 1: basic save screenshot to x folder!
-- save to "screenshots" folder as "filename.png"!
createScreenshot("screenshots/filename.png")
Example 2: save screenshot to x folder & include time stamp!
function exportScreenshot()
local time = os.date("%D-%M-%Y_%H-%M-%S")
createScreenshot("screenshots/filename_" .. 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
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.
Return
none