Files
GDevelop/Extensions/Screenshot/JsExtension.js
T
Florian Rival 02c65bcf66 [WIP] Add translations support, using js-lingui, to newIDE (including libGD.js)
* Upgrade to Flow 0.92 and make fixes for it
* Convert all extensions to use _("...") instead of t("...") for translations,
  to be able to be parsed by gettext
* Handle translation in JS extensions
* Move Providers out of MainFrame
* Remove i18next
* Adapt ExtractTranslations script to handle js files (for extensions)
2019-02-09 14:08:22 +00:00

48 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* This is a declaration of an extension for GDevelop 5.
*
* ️ Run `node import-GDJS-Runtime.js` (in newIDE/app/scripts) if you make any change
* to this extension file or to any other *.js file that you reference inside.
*
* The file must be named "JsExtension.js", otherwise GDevelop won't load it.
* ⚠️ If you make a change and the extension is not loaded, open the developer console
* and search for any errors.
*
* More information on https://github.com/4ian/GDevelop/blob/master/newIDE/README-extensions.md
*/
module.exports = {
createExtension: function (_, gd) {
const extension = new gd.PlatformExtension();
extension.setExtensionInformation(
"Screenshot",
_("Screenshot"),
_(
"Save screenshots of a running game."
),
"Matthias Meike",
"Open source (MIT License)"
).setExtensionHelpPath("/all-features/screenshot");
extension
.addAction(
"TakeScreenshot",
_("Take screenshot"),
_("Take a screenshot of the game, and save it to a png file (supported only when running on Windows/Linux/macOS)."),
_("Take a screenshot and save at _PARAM1_"),
_("Screenshot"),
"JsPlatform/Extensions/take_screenshot24.png",
"JsPlatform/Extensions/take_screenshot32.png"
)
.addCodeOnlyParameter('currentScene', '')
.addParameter("string", _("Save path"), "", false)
.getCodeExtraInformation()
.setIncludeFile(
"Extensions/Screenshot/screenshottools.js"
)
.setFunctionName("gdjs.screenshot.takeScreenshot");
return extension;
},
runExtensionSanityTests: function (gd, extension) { return []; },
};