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

Export a project or a layout to a playable HTML5/Javascript based game. More...

#include <Exporter.h>

Public Member Functions

 Exporter (gd::AbstractFileSystem &fileSystem, gd::String gdjsRoot_="./JsPlatform")
 
bool ExportProjectForPixiPreview (const PreviewExportOptions &options)
 Create a preview for the specified options. More...
 
bool ExportWholePixiProject (const ExportOptions &options)
 Export the specified project, using Pixi.js. More...
 
const gd::String & GetLastError () const
 Return the error that occurred during the last export.
 
void SetCodeOutputDirectory (gd::String codeOutputDir_)
 Change the directory where code files are generated. More...
 
void SerializeProjectData (const gd::Project &project, const PreviewExportOptions &options, gd::SerializerElement &projectDataElement)
 Serialize a project without its events to JSON. More...
 
void SerializeRuntimeGameOptions (const PreviewExportOptions &options, gd::SerializerElement &runtimeGameOptionsElement)
 Serialize the content of the extra configuration to store in gdjs.runtimeGameOptions to JSON. More...
 

Detailed Description

Export a project or a layout to a playable HTML5/Javascript based game.

Member Function Documentation

◆ ExportProjectForPixiPreview()

bool gdjs::Exporter::ExportProjectForPixiPreview ( const PreviewExportOptions options)

Create a preview for the specified options.

Note
The preview is not launched, it is the caller responsibility to open a browser pointing to the preview.
Parameters
optionsThe options to generate the preview.

◆ ExportWholePixiProject()

bool gdjs::Exporter::ExportWholePixiProject ( const ExportOptions options)

Export the specified project, using Pixi.js.

Called by ShowProjectExportDialog if the user clicked on Ok.

◆ SerializeProjectData()

void gdjs::Exporter::SerializeProjectData ( const gd::Project &  project,
const PreviewExportOptions options,
gd::SerializerElement &  projectDataElement 
)

Serialize a project without its events to JSON.

Parameters
projectThe project to be exported
optionsThe content of the extra configuration
projectDataElementThe element where the project data is serialized

◆ SerializeRuntimeGameOptions()

void gdjs::Exporter::SerializeRuntimeGameOptions ( const PreviewExportOptions options,
gd::SerializerElement &  runtimeGameOptionsElement 
)

Serialize the content of the extra configuration to store in gdjs.runtimeGameOptions to JSON.

Warning
ExportProjectForPixiPreview must be called first to serialize the list of scripts files.
Parameters
optionsThe content of the extra configuration
runtimeGameOptionsElementThe element where the game options are serialized

◆ SetCodeOutputDirectory()

void gdjs::Exporter::SetCodeOutputDirectory ( gd::String  codeOutputDir_)
inline

Change the directory where code files are generated.

By default, this is set to a temporary directory.


The documentation for this class was generated from the following files: