GDevelop JS Platform
Platform for developing HTML5/Javascript based games with GDevelop
Public Member Functions | Public Attributes | List of all members
gdjs::PreviewExportOptions Struct Reference

The options used to export a project for a preview. More...

#include <ExporterHelper.h>

Public Member Functions

 PreviewExportOptions (gd::Project &project_, const gd::String &exportPath_)
 
PreviewExportOptionsUseWebsocketDebuggerClientWithServerAddress (const gd::String &address, const gd::String &port)
 Set the address of the debugger server that the game should reach out to, using the "WebSockets" debugger client.
 
PreviewExportOptionsSetInAppTutorialMessageInPreview (const gd::String &message, const gd::String &position)
 Set the message to display to the user in a preview (as part of an in-app tutorial).
 
PreviewExportOptionsSetFallbackAuthor (const gd::String &id, const gd::String &username)
 Set the fallback author info (if info not present in project properties).
 
PreviewExportOptionsSetAuthenticatedPlayer (const gd::String &id, const gd::String &username, const gd::String &token)
 Set the fallback author info (if info not present in project properties).
 
PreviewExportOptionsUseWindowMessageDebuggerClient ()
 Set that the game should connect to the debugger server using the "Window Message " debugger client.
 
PreviewExportOptionsUseMinimalDebuggerClient ()
 Set that the game should have a minimal debugger client.
 
PreviewExportOptionsSetNativeMobileApp (bool enable)
 Set that the preview is launched from a GDevelop native mobile app (iOS or Android).
 
PreviewExportOptionsSetLayoutName (const gd::String &layoutName_)
 Set the layout to be run first in the previewed game.
 
PreviewExportOptionsSetExternalLayoutName (const gd::String &externalLayoutName_)
 Set the (optional) external layout to be instantiated in the scene at the beginning of the previewed game.
 
PreviewExportOptionsSetIncludeFileHash (const gd::String &includeFile, int hash)
 Set the hash associated to an include file. Useful for the preview hot-reload, to know if a file changed.
 
PreviewExportOptionsSetProjectDataOnlyExport (bool enable)
 Set if the export should only export the project data, not exporting events code.
 
PreviewExportOptionsSetFullLoadingScreen (bool enable)
 Set if the export should show the full loading screen (false by default, skipping the minimum duration and GDevelop logo).
 
PreviewExportOptionsSetIsDevelopmentEnvironment (bool enable)
 Set if the export should consider to be in a development environment of GDevelop (the game should use GDevelop development APIs).
 
PreviewExportOptionsSetNonRuntimeScriptsCacheBurst (unsigned int value)
 If set to a non zero value, the exported script URLs will have an extra search parameter added (with the given value) to ensure browser cache is bypassed when they are loaded.
 
PreviewExportOptionsSetElectronRemoteRequirePath (const gd::String &electronRemoteRequirePath_)
 
PreviewExportOptionsSetGDevelopResourceToken (const gd::String &gdevelopResourceToken_)
 
PreviewExportOptionsSetAllowAuthenticationUsingIframeForPreview (bool allowAuthenticationUsingIframeForPreview_)
 
PreviewExportOptionsSetCrashReportUploadLevel (const gd::String &crashReportUploadLevel_)
 Set the level of crash reports to be sent to GDevelop APIs.
 
PreviewExportOptionsSetPreviewContext (const gd::String &previewContext_)
 Set the context of the preview.
 
PreviewExportOptionsSetGDevelopVersionWithHash (const gd::String &gdevelopVersionWithHash_)
 Set the GDevelop version so the game is aware of it.
 
PreviewExportOptionsSetProjectTemplateSlug (const gd::String &projectTemplateSlug_)
 Set the template slug that was used to create the project.
 
PreviewExportOptionsSetSourceGameId (const gd::String &sourceGameId_)
 Set the source game id that was used to create the project.
 
PreviewExportOptionsAddScreenshotCapture (int delayTimeInSeconds, const gd::String &signedUrl, const gd::String &publicUrl)
 Set the capture options to be used for taking screenshots or videos of the preview.
 

Public Attributes

gd::Project & project
 
gd::String exportPath
 
gd::String websocketDebuggerServerAddress
 
gd::String websocketDebuggerServerPort
 
bool useWindowMessageDebuggerClient
 
bool useMinimalDebuggerClient
 
gd::String layoutName
 
gd::String externalLayoutName
 
gd::String fallbackAuthorUsername
 
gd::String fallbackAuthorId
 
gd::String playerId
 
gd::String playerUsername
 
gd::String playerToken
 
gd::String inAppTutorialMessageInPreview
 
gd::String inAppTutorialMessagePositionInPreview
 
bool nativeMobileApp
 
std::map< gd::String, int > includeFileHashes
 
bool projectDataOnlyExport
 
bool fullLoadingScreen
 
bool isDevelopmentEnvironment
 
unsigned int nonRuntimeScriptsCacheBurst
 
gd::String electronRemoteRequirePath
 
gd::String gdevelopResourceToken
 
bool allowAuthenticationUsingIframeForPreview
 
gd::String crashReportUploadLevel
 
gd::String previewContext
 
gd::String gdevelopVersionWithHash
 
gd::String projectTemplateSlug
 
gd::String sourceGameId
 
gd::CaptureOptions captureOptions
 

Detailed Description

The options used to export a project for a preview.

Constructor & Destructor Documentation

◆ PreviewExportOptions()

gdjs::PreviewExportOptions::PreviewExportOptions ( gd::Project &  project_,
const gd::String &  exportPath_ 
)
inline
Parameters
project_The project to export
exportPath_The path in the filesystem where to export the files

Member Function Documentation

◆ SetAllowAuthenticationUsingIframeForPreview()

PreviewExportOptions& gdjs::PreviewExportOptions::SetAllowAuthenticationUsingIframeForPreview ( bool  allowAuthenticationUsingIframeForPreview_)
inline

Set if, in some exceptional cases, we allow authentication to be done through a iframe. This is usually discouraged as the user can't verify that the authentication window is a genuine one. It's only to be used in trusted contexts.

◆ SetElectronRemoteRequirePath()

PreviewExportOptions& gdjs::PreviewExportOptions::SetElectronRemoteRequirePath ( const gd::String &  electronRemoteRequirePath_)
inline

Set the path to use for the game engine to require "@electron/remote". This is because the preview is run in a folder without any node_module, but this is still required for now for some features. This should be removed once the dependency to "@electron/remote" is removed.

◆ SetGDevelopResourceToken()

PreviewExportOptions& gdjs::PreviewExportOptions::SetGDevelopResourceToken ( const gd::String &  gdevelopResourceToken_)
inline

Set the token to use by the game engine when requiring any resource stored on GDevelop Cloud buckets. Note that this is only useful during previews.


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