GDevelop JS Platform
Platform for developing HTML5/Javascript based games with GDevelop
Exporter.h
1 /*
2  * GDevelop JS Platform
3  * Copyright 2008-2016 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #ifndef EXPORTER_H
7 #define EXPORTER_H
8 #include <map>
9 #include <set>
10 #include <string>
11 #include <vector>
12 
13 #include "GDCore/String.h"
14 namespace gd {
15 class Project;
16 class Layout;
17 class ExternalLayout;
18 class AbstractFileSystem;
19 class SerializerElement;
20 } // namespace gd
21 namespace gdjs {
22 struct PreviewExportOptions;
23 struct ExportOptions;
24 }
25 
26 namespace gdjs {
27 
32 class Exporter {
33  public:
34  Exporter(gd::AbstractFileSystem& fileSystem,
35  gd::String gdjsRoot_ = "./JsPlatform");
36  virtual ~Exporter();
37 
46 
52  bool ExportWholePixiProject(const ExportOptions& options);
53 
57  const gd::String& GetLastError() const { return lastError; };
58 
64  void SetCodeOutputDirectory(gd::String codeOutputDir_) {
65  codeOutputDir = codeOutputDir_;
66  }
67 
75  void SerializeProjectData(const gd::Project &project,
76  const PreviewExportOptions &options,
77  gd::SerializerElement &projectDataElement);
78 
90  void
92  gd::SerializerElement &runtimeGameOptionsElement);
93 
94 private:
95  gd::AbstractFileSystem&
96  fs;
97  gd::String lastError;
98  gd::String
99  gdjsRoot;
100  gd::String codeOutputDir;
102  std::vector<gd::String>
103  includesFiles;
104 };
105 
106 } // namespace gdjs
107 #endif // EXPORTER_H
Export a project or a layout to a playable HTML5/Javascript based game.
Definition: Exporter.h:32
void SerializeProjectData(const gd::Project &project, const PreviewExportOptions &options, gd::SerializerElement &projectDataElement)
Serialize a project without its events to JSON.
Definition: Exporter.cpp:205
const gd::String & GetLastError() const
Return the error that occurred during the last export.
Definition: Exporter.h:57
void SetCodeOutputDirectory(gd::String codeOutputDir_)
Change the directory where code files are generated.
Definition: Exporter.h:64
bool ExportWholePixiProject(const ExportOptions &options)
Export the specified project, using Pixi.js.
Definition: Exporter.cpp:57
void SerializeRuntimeGameOptions(const PreviewExportOptions &options, gd::SerializerElement &runtimeGameOptionsElement)
Serialize the content of the extra configuration to store in gdjs.runtimeGameOptions to JSON.
Definition: Exporter.cpp:212
bool ExportProjectForPixiPreview(const PreviewExportOptions &options)
Create a preview for the specified options.
Definition: Exporter.cpp:51
The options used to export a project.
Definition: ExporterHelper.h:425
The options used to export a project for a preview.
Definition: ExporterHelper.h:35