GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Public Member Functions | Static Public Member Functions | List of all members

Base class representing a project (game), including all resources, scenes, objects, extensions... More...

#include <Project.h>

Public Member Functions

 Project (const Project &)
 
Projectoperator= (const Project &rhs)
 
void UnserializeFrom (const SerializerElement &element)
 Unserialize the project from an element.
 
void SerializeTo (SerializerElement &element) const
 Serialize the project. More...
 
unsigned int GetLastSaveGDMajorVersion ()
 
unsigned int GetLastSaveGDMinorVersion ()
 
unsigned int GetLastSaveGDBuildVersion ()
 
gd::WholeProjectDiagnosticReportGetWholeProjectDiagnosticReport ()
 
Common properties

Some properties for the project

void SetName (const gd::String &name_)
 Change the project name.
 
const gd::StringGetName () const
 Get the project name.
 
const std::vector< gd::String > & GetCategories () const
 Get the categories/genres of the project.
 
std::vector< gd::String > & GetCategories ()
 Get the categories of the project, to modify them (non-const).
 
void SetDescription (const gd::String &description_)
 Change the project description.
 
const gd::StringGetDescription () const
 Get the project description.
 
void SetVersion (const gd::String &version_)
 Change the version of the project. This can be freely set, but should follow "X.Y.Z" format for compatibility with some exporters.
 
const gd::StringGetVersion () const
 Get the project version.
 
void SetAuthor (const gd::String &author_)
 Change the author of the project.
 
const gd::StringGetAuthor () const
 Get the project author name.
 
const std::vector< gd::String > & GetAuthorIds () const
 Get the author ids of the project.
 
std::vector< gd::String > & GetAuthorIds ()
 Get the author ids of the project, to modify them (non-const).
 
const std::vector< gd::String > & GetAuthorUsernames () const
 Get the author usernames of the project.
 
std::vector< gd::String > & GetAuthorUsernames ()
 Get the author usernames of the project, to modify them (non-const).
 
void SetPlayableWithKeyboard (bool playable=true)
 
bool IsPlayableWithKeyboard () const
 
void SetPlayableWithGamepad (bool playable=true)
 
bool IsPlayableWithGamepad () const
 
void SetPlayableWithMobile (bool playable=true)
 
bool IsPlayableWithMobile () const
 
void SetPackageName (const gd::String &packageName_)
 Change the project package name.
 
const gd::StringGetPackageName () const
 Get the project package name.
 
void SetTemplateSlug (const gd::String &templateSlug_)
 Change the slug of the template from which the project is created.
 
const gd::StringGetTemplateSlug () const
 Get the slug of the template from which the project is created.
 
void SetOrientation (const gd::String &orientation_)
 Change the project orientation (in particular when exported with Cordova). This has no effect on desktop and web browsers. More...
 
const gd::StringGetOrientation () const
 Get the project orientation ("default", "landscape", "portrait").
 
void SetProjectFile (const gd::String &file)
 
const gd::StringGetProjectFile () const
 
void SetFolderProject (bool enable=true)
 
bool IsFolderProject () const
 
void SetLastCompilationDirectory (const gd::String &dir)
 
const gd::StringGetLastCompilationDirectory () const
 
gd::PlatformSpecificAssetsGetPlatformSpecificAssets ()
 Return a reference to platform assets of the project (icons, splashscreen...).
 
const gd::PlatformSpecificAssetsGetPlatformSpecificAssets () const
 Return a reference to platform assets of the project (icons, splashscreen...).
 
gd::LoadingScreenGetLoadingScreen ()
 Return a reference to loading screen setup for the project.
 
const gd::LoadingScreenGetLoadingScreen () const
 Return a reference to loading screen setup for the project.
 
gd::WatermarkGetWatermark ()
 Return a reference to watermark setup for the project.
 
const gd::WatermarkGetWatermark () const
 Return a reference to watermark setup for the project.
 
void SetGameResolutionSize (unsigned int width, unsigned int height)
 
unsigned int GetGameResolutionWidth () const
 Returns the default game resolution width.
 
unsigned int GetGameResolutionHeight () const
 Returns the default game resolution height.
 
bool GetAdaptGameResolutionAtRuntime () const
 Returns true if the game resolution should be adapted to the window size at runtime.
 
void SetAdaptGameResolutionAtRuntime (bool adaptGameResolutionAtRuntime_)
 Set if the game resolution should be adapted to the window size at runtime. More...
 
const gd::StringGetSizeOnStartupMode () const
 Get how the game size should be adapted to the screen.
 
void SetSizeOnStartupMode (const gd::String &mode)
 Set how to adapt the game size to the screen. More...
 
void SetMaximumFPS (int maxFPS_)
 
int GetMaximumFPS () const
 
void SetMinimumFPS (unsigned int minFPS_)
 
unsigned int GetMinimumFPS () const
 
bool IsVerticalSynchronizationEnabledByDefault () const
 
void SetVerticalSyncActivatedByDefault (bool enable)
 
const gd::StringGetScaleMode () const
 
void SetScaleMode (const gd::String &scaleMode_)
 
bool GetPixelsRounding () const
 
void SetPixelsRounding (bool enable)
 
const gd::StringGetAntialiasingMode () const
 
void SetAntialiasingMode (const gd::String &antialiasingMode_)
 
bool IsAntialisingEnabledOnMobile () const
 
void SetAntialisingEnabledOnMobile (bool enable)
 
bool GetUseDeprecatedZeroAsDefaultZOrder () const
 Return if the project should set 0 as Z-order for objects created from events (which is deprecated) - instead of the highest Z order that was found on each layer when the scene started.
 
void SetUseDeprecatedZeroAsDefaultZOrder (bool enable)
 Set if the project should set 0 as Z-order for objects created from events (which is deprecated) - instead of the highest Z order that was found on each layer when the scene started.
 
void SetProjectUuid (const gd::String &projectUuid_)
 Change the project UUID.
 
const gd::StringGetProjectUuid () const
 Get the project UUID, useful when using the game on online services that would require a unique identifier.
 
void ResetProjectUuid ()
 Create a new project UUID.
 
gd::ExtensionPropertiesGetExtensionProperties ()
 Get the properties set by extensions. More...
 
const gd::ExtensionPropertiesGetExtensionProperties () const
 Get the properties set by extensions. More...
 
const std::vector< Platform * > & GetUsedPlatforms () const
 
void AddPlatform (Platform &platform)
 
bool RemovePlatform (const gd::String &platformName)
 
PlatformGetCurrentPlatform () const
 Return a reference to the platform being currently used to edit the project.
 
void SetCurrentPlatform (const gd::String &platformName)
 Set the platform to be used to edit the project. More...
 
Factory method

Member functions used to create objects for the project

std::unique_ptr< gd::ObjectCreateObject (const gd::String &type, const gd::String &name) const
 
void EnsureObjectDefaultBehaviors (gd::Object &object) const
 
std::shared_ptr< gd::BaseEventCreateEvent (const gd::String &type, const gd::String &platformName="")
 
Layouts management

Members functions related to layout management.

bool HasLayoutNamed (const gd::String &name) const
 Return true if layout called "name" exists.
 
LayoutGetLayout (const gd::String &name)
 Return a reference to the layout called "name".
 
const LayoutGetLayout (const gd::String &name) const
 Return a reference to the layout called "name".
 
LayoutGetLayout (std::size_t index)
 Return a reference to the layout at position "index" in the layout list.
 
const LayoutGetLayout (std::size_t index) const
 Return a reference to the layout at position "index" in the layout list.
 
std::size_t GetLayoutPosition (const gd::String &name) const
 Return the position of the layout called "name" in the layout list.
 
void MoveLayout (std::size_t oldIndex, std::size_t newIndex)
 
void SwapLayouts (std::size_t first, std::size_t second)
 Swap the specified layouts. More...
 
std::size_t GetLayoutsCount () const
 Return the number of layouts.
 
gd::LayoutInsertNewLayout (const gd::String &name, std::size_t position)
 Add a new empty layout called "name" at the specified position in the layout list.
 
gd::LayoutInsertLayout (const Layout &layout, std::size_t position)
 Add a new layout constructed from the layout passed as parameter. More...
 
void RemoveLayout (const gd::String &name)
 Delete layout named "name".
 
External events management

Members functions related to external events management.

bool HasExternalEventsNamed (const gd::String &name) const
 
ExternalEventsGetExternalEvents (const gd::String &name)
 
const ExternalEventsGetExternalEvents (const gd::String &name) const
 
ExternalEventsGetExternalEvents (std::size_t index)
 
const ExternalEventsGetExternalEvents (std::size_t index) const
 
std::size_t GetExternalEventsPosition (const gd::String &name) const
 
void MoveExternalEvents (std::size_t oldIndex, std::size_t newIndex)
 
void SwapExternalEvents (std::size_t first, std::size_t second)
 Swap the specified external events. More...
 
std::size_t GetExternalEventsCount () const
 
ExternalEventsInsertNewExternalEvents (const gd::String &name, std::size_t position)
 Adds a new empty external events sheet called "name" at the specified position in the layout list.
 
ExternalEventsInsertExternalEvents (const ExternalEvents &externalEvents, std::size_t position)
 Adds a new external events sheet constructed from the layout passed as parameter. More...
 
void RemoveExternalEvents (const gd::String &name)
 Delete external events named "name".
 
External layout management

Members functions related to external layout management.

bool HasExternalLayoutNamed (const gd::String &name) const
 
ExternalLayoutGetExternalLayout (const gd::String &name)
 
const ExternalLayoutGetExternalLayout (const gd::String &name) const
 
ExternalLayoutGetExternalLayout (std::size_t index)
 
const ExternalLayoutGetExternalLayout (std::size_t index) const
 
std::size_t GetExternalLayoutPosition (const gd::String &name) const
 
void MoveExternalLayout (std::size_t oldIndex, std::size_t newIndex)
 
void SwapExternalLayouts (std::size_t first, std::size_t second)
 Swap the specified external layouts. More...
 
std::size_t GetExternalLayoutsCount () const
 
gd::ExternalLayoutInsertNewExternalLayout (const gd::String &name, std::size_t position)
 Adds a new empty external layout called "name" at the specified position in the layout list.
 
gd::ExternalLayoutInsertExternalLayout (const ExternalLayout &externalLayout, std::size_t position)
 Adds a new external layout constructed from the layout passed as parameter. More...
 
void RemoveExternalLayout (const gd::String &name)
 Delete external layout named "name".
 
void SetFirstLayout (const gd::String &name)
 
const gd::StringGetFirstLayout ()
 
Events functions extensions management
bool HasEventsFunctionsExtensionNamed (const gd::String &name) const
 Check if events functions extension called "name" exists.
 
EventsFunctionsExtensionGetEventsFunctionsExtension (const gd::String &name)
 Return a reference to the events functions extension called "name".
 
const EventsFunctionsExtensionGetEventsFunctionsExtension (const gd::String &name) const
 Return a reference to the events functions extension called "name".
 
EventsFunctionsExtensionGetEventsFunctionsExtension (std::size_t index)
 Return a reference to the events functions extension at position "index" in the list.
 
const EventsFunctionsExtensionGetEventsFunctionsExtension (std::size_t index) const
 Return a reference to the events functions extension at position "index" in the list.
 
std::size_t GetEventsFunctionsExtensionPosition (const gd::String &name) const
 Return the position of the events functions extension called "name" in the list.
 
void MoveEventsFunctionsExtension (std::size_t oldIndex, std::size_t newIndex)
 
void SwapEventsFunctionsExtensions (std::size_t first, std::size_t second)
 Swap the specified events functions extensions. More...
 
std::size_t GetEventsFunctionsExtensionsCount () const
 Returns the number of events functions extension.
 
gd::EventsFunctionsExtensionInsertNewEventsFunctionsExtension (const gd::String &name, std::size_t position)
 Adds a new empty events functions extension called "name" at the specified position in the list.
 
gd::EventsFunctionsExtensionInsertEventsFunctionsExtension (const EventsFunctionsExtension &eventsFunctionExtension, std::size_t position)
 Adds an events functions extension to the list. More...
 
void UnserializeAndInsertExtensionsFrom (const gd::SerializerElement &eventsFunctionsExtensionsElement)
 Unserialize and insert in the project the extensions. More...
 
void RemoveEventsFunctionsExtension (const gd::String &name)
 Delete the events functions extension named "name".
 
void ClearEventsFunctionsExtensions ()
 Remove all the events functions extensions.
 
bool HasEventsBasedObject (const gd::String &type) const
 Check if events based object with a given type exists.
 
gd::EventsBasedObjectGetEventsBasedObject (const gd::String &type)
 Return the events based object with a given type.
 
const gd::EventsBasedObjectGetEventsBasedObject (const gd::String &type) const
 Return the events based object with a given type.
 
bool HasEventsBasedBehavior (const gd::String &type) const
 Check if events based behavior with a given type exists.
 
gd::EventsBasedBehaviorGetEventsBasedBehavior (const gd::String &type)
 Return the events based behavior with a given type.
 
const gd::EventsBasedBehaviorGetEventsBasedBehavior (const gd::String &type) const
 Return the events based behavior with a given type.
 
Resources management

Members functions related to resources management.

const ResourcesManagerGetResourcesManager () const
 Provide access to the ResourceManager member containing the list of the resources.
 
ResourcesManagerGetResourcesManager ()
 Provide access to the ResourceManager member containing the list of the resources.
 
Variable management

Members functions related to global variables management.

const gd::VariablesContainerGetVariables () const
 
gd::VariablesContainerGetVariables ()
 
Global objects
gd::ObjectsContainerGetObjects ()
 return the objects of the project.
 
const gd::ObjectsContainerGetObjects () const
 Return the objects of the project.
 
External source files

To manage external C++ or Javascript source files used by the game

bool UseExternalSourceFiles () const
 Return true if the game activated the use of external source files.
 
const std::vector< std::unique_ptr< gd::SourceFile > > & GetAllSourceFiles () const
 Return a const reference to the vector containing all the source files used by the game.
 
bool HasSourceFile (gd::String name, gd::String language="") const
 Return true if the source file with the specified name is used by the game. More...
 
SourceFileGetSourceFile (const gd::String &name)
 
const SourceFileGetSourceFile (const gd::String &name) const
 
void RemoveSourceFile (const gd::String &name)
 
gd::SourceFileInsertNewSourceFile (const gd::String &name, const gd::String &language, std::size_t position=-1)
 

Static Public Member Functions

static std::vector< gd::StringGetUnserializingOrderExtensionNames (const gd::SerializerElement &eventsFunctionsExtensionsElement)
 Get the project extensions names in the order they have to be unserialized. More...
 
Identifier names
static bool IsNameSafe (const gd::String &name)
 
static gd::String GetSafeName (const gd::String &name)
 

Detailed Description

Base class representing a project (game), including all resources, scenes, objects, extensions...

Member Function Documentation

◆ AddPlatform()

void gd::Project::AddPlatform ( Platform platform)

Add a platform to the project

◆ CreateEvent()

std::shared_ptr< gd::BaseEvent > gd::Project::CreateEvent ( const gd::String type,
const gd::String platformName = "" 
)

Create an event of the given type.

Note
A project can use more than one platform. In this case, the first platform supporting the event is used, unless platformName argument is not empty.
It is assumed that each platform provides equivalent events.
Parameters
projectThe project for which the event must be created.
typeThe type of the event
platformNameThe name of the platform to be used. If empty, the first platform supporting the object is used.

◆ CreateObject()

std::unique_ptr< gd::Object > gd::Project::CreateObject ( const gd::String type,
const gd::String name 
) const

Create an object of the given type with the specified name.

Parameters
typeThe type of the object
nameThe name of the object

◆ GetAntialiasingMode()

const gd::String& gd::Project::GetAntialiasingMode ( ) const
inline

Return the antialiasing mode used by the game ("none" or "MSAA").

◆ GetExtensionProperties() [1/2]

gd::ExtensionProperties& gd::Project::GetExtensionProperties ( )
inline

Get the properties set by extensions.

Each extension can store arbitrary values indexed by a property name, which are useful to store project wide settings (AdMob id, etc...).

◆ GetExtensionProperties() [2/2]

const gd::ExtensionProperties& gd::Project::GetExtensionProperties ( ) const
inline

Get the properties set by extensions.

Each extension can store arbitrary values indexed by a property name, which are useful to store project wide settings (AdMob id, etc...).

◆ GetExternalEvents() [1/4]

gd::ExternalEvents & gd::Project::GetExternalEvents ( const gd::String name)

Return a reference to the external events called "name".

◆ GetExternalEvents() [2/4]

const gd::ExternalEvents & gd::Project::GetExternalEvents ( const gd::String name) const

Return a reference to the external events called "name".

◆ GetExternalEvents() [3/4]

gd::ExternalEvents & gd::Project::GetExternalEvents ( std::size_t  index)

Return a reference to the external events at position "index" in the external events list

◆ GetExternalEvents() [4/4]

const gd::ExternalEvents & gd::Project::GetExternalEvents ( std::size_t  index) const

Return a reference to the external events at position "index" in the external events list

◆ GetExternalEventsCount()

std::size_t gd::Project::GetExternalEventsCount ( ) const

Return the number of external events.

◆ GetExternalEventsPosition()

std::size_t gd::Project::GetExternalEventsPosition ( const gd::String name) const

Return the position of the external events called "name" in the external events list

◆ GetExternalLayout() [1/4]

gd::ExternalLayout & gd::Project::GetExternalLayout ( const gd::String name)

Return a reference to the external layout called "name".

◆ GetExternalLayout() [2/4]

const gd::ExternalLayout & gd::Project::GetExternalLayout ( const gd::String name) const

Return a reference to the external layout called "name".

◆ GetExternalLayout() [3/4]

gd::ExternalLayout & gd::Project::GetExternalLayout ( std::size_t  index)

Return a reference to the external layout at position "index" in the external layout list

◆ GetExternalLayout() [4/4]

const gd::ExternalLayout & gd::Project::GetExternalLayout ( std::size_t  index) const

Return a reference to the external layout at position "index" in the external layout list

◆ GetExternalLayoutPosition()

std::size_t gd::Project::GetExternalLayoutPosition ( const gd::String name) const

Return the position of the external layout called "name" in the external layout list

◆ GetExternalLayoutsCount()

std::size_t gd::Project::GetExternalLayoutsCount ( ) const

Return the number of external layout.

◆ GetFirstLayout()

const gd::String& gd::Project::GetFirstLayout ( )
inline

Get the first layout of the project.

◆ GetLastCompilationDirectory()

const gd::String& gd::Project::GetLastCompilationDirectory ( ) const
inline

Return the latest directory used to compile the game

See also
gd::Project::SetLastCompilationDirectory

◆ GetLastSaveGDBuildVersion()

unsigned int gd::Project::GetLastSaveGDBuildVersion ( )
inline

Get the minor version of GDevelop used to save the project.

◆ GetLastSaveGDMajorVersion()

unsigned int gd::Project::GetLastSaveGDMajorVersion ( )
inline

Get the major version of GDevelop used to save the project.

◆ GetLastSaveGDMinorVersion()

unsigned int gd::Project::GetLastSaveGDMinorVersion ( )
inline

Get the minor version of GDevelop used to save the project.

◆ GetMaximumFPS()

int gd::Project::GetMaximumFPS ( ) const
inline

Get the default number of maximum frame par seconds

◆ GetMinimumFPS()

unsigned int gd::Project::GetMinimumFPS ( ) const
inline

Get the default number of minimum frame par seconds

◆ GetPixelsRounding()

bool gd::Project::GetPixelsRounding ( ) const
inline

Return true if pixels rounding option is enabled.

◆ GetProjectFile()

const gd::String& gd::Project::GetProjectFile ( ) const
inline

Return project file

See also
gd::Project::SetProjectFile

◆ GetSafeName()

gd::String gd::Project::GetSafeName ( const gd::String name)
static

Return a name, based on the one passed in parameter, that can be safely used for an object, behavior, events function name, etc...

◆ GetScaleMode()

const gd::String& gd::Project::GetScaleMode ( ) const
inline

Return the scale mode used by the game (usually "linear" or "nearest").

◆ GetSourceFile() [1/2]

gd::SourceFile & gd::Project::GetSourceFile ( const gd::String name)

Return a reference to the external source file with the given name.

◆ GetSourceFile() [2/2]

const gd::SourceFile & gd::Project::GetSourceFile ( const gd::String name) const

Return a reference to the external source file with the given name.

◆ GetUnserializingOrderExtensionNames()

std::vector< gd::String > gd::Project::GetUnserializingOrderExtensionNames ( const gd::SerializerElement eventsFunctionsExtensionsElement)
static

Get the project extensions names in the order they have to be unserialized.

Child-objects need the event-based objects they use to be loaded completely before they are unserialized.

Warning
This is only public to allow testing - don't use it in the editor.

◆ GetUsedPlatforms()

const std::vector<Platform*>& gd::Project::GetUsedPlatforms ( ) const
inline

Return the list of platforms used by the project.

◆ GetVariables() [1/2]

gd::VariablesContainer& gd::Project::GetVariables ( )
inline

Provide access to the gd::VariablesContainer member containing the global variables

◆ GetVariables() [2/2]

const gd::VariablesContainer& gd::Project::GetVariables ( ) const
inline

Provide access to the gd::VariablesContainer member containing the global variables

◆ HasExternalEventsNamed()

bool gd::Project::HasExternalEventsNamed ( const gd::String name) const

Return true if external events called "name" exists.

◆ HasExternalLayoutNamed()

bool gd::Project::HasExternalLayoutNamed ( const gd::String name) const

Return true if external layout called "name" exists.

◆ HasSourceFile()

bool gd::Project::HasSourceFile ( gd::String  name,
gd::String  language = "" 
) const

Return true if the source file with the specified name is used by the game.

Parameters
nameThe filename of the source file.
languageOptional. If specified, check that the source file that exists is in this language.

◆ InsertEventsFunctionsExtension()

gd::EventsFunctionsExtension & gd::Project::InsertEventsFunctionsExtension ( const EventsFunctionsExtension eventsFunctionExtension,
std::size_t  position 
)

Adds an events functions extension to the list.

Note
A copy of it is stored in the project (and returned).
Returns
The newly stored events functions extension (a copy of the one passed as parameter).

◆ InsertExternalEvents()

gd::ExternalEvents & gd::Project::InsertExternalEvents ( const ExternalEvents externalEvents,
std::size_t  position 
)

Adds a new external events sheet constructed from the layout passed as parameter.

Note
No pointer or reference must be kept on the external events passed as parameter.
Parameters
externalEventsThe external events that must be copied and inserted into the project
positionInsertion position. Even if the position is invalid, the external events must be inserted at the end of the external events list.

◆ InsertExternalLayout()

gd::ExternalLayout & gd::Project::InsertExternalLayout ( const ExternalLayout externalLayout,
std::size_t  position 
)

Adds a new external layout constructed from the layout passed as parameter.

Note
No pointer or reference must be kept on the external layout passed as parameter.
Parameters
externalLayoutThe external layout that must be copied and inserted into the projects
positionInsertion position. Even if the position is invalid, the external layout must be inserted at the end of the external layout list.

◆ InsertLayout()

gd::Layout & gd::Project::InsertLayout ( const Layout layout,
std::size_t  position 
)

Add a new layout constructed from the layout passed as parameter.

Parameters
layoutThe layout that must be copied and inserted into the project
positionInsertion position. Even if the position is invalid, the layout must be inserted at the end of the layout list.
Note
No pointer or reference must be kept on the layout passed as parameter.

◆ InsertNewSourceFile()

gd::SourceFile & gd::Project::InsertNewSourceFile ( const gd::String name,
const gd::String language,
std::size_t  position = -1 
)

Add a new source file the specified position in the external source files list.

◆ IsAntialisingEnabledOnMobile()

bool gd::Project::IsAntialisingEnabledOnMobile ( ) const
inline

Return true if antialising is enabled on mobiles.

◆ IsFolderProject()

bool gd::Project::IsFolderProject ( ) const
inline

Check if the project is saved as a folder project.

See also
gd::Project::SetFolderProject

◆ IsNameSafe()

bool gd::Project::IsNameSafe ( const gd::String name)
static

Return true if name is valid (can be used safely for an object, behavior, events function name, etc...).

◆ IsPlayableWithGamepad()

bool gd::Project::IsPlayableWithGamepad ( ) const
inline

Check if the project is defined as playable with a gamepad.

◆ IsPlayableWithKeyboard()

bool gd::Project::IsPlayableWithKeyboard ( ) const
inline

Check if the project is defined as playable with a keyboard.

◆ IsPlayableWithMobile()

bool gd::Project::IsPlayableWithMobile ( ) const
inline

Check if the project is defined as playable on a mobile.

◆ IsVerticalSynchronizationEnabledByDefault()

bool gd::Project::IsVerticalSynchronizationEnabledByDefault ( ) const
inline

Return true if vertical synchronization is enabled by default.

◆ MoveEventsFunctionsExtension()

void gd::Project::MoveEventsFunctionsExtension ( std::size_t  oldIndex,
std::size_t  newIndex 
)

Change the position of the specified events function extension.

◆ MoveExternalEvents()

void gd::Project::MoveExternalEvents ( std::size_t  oldIndex,
std::size_t  newIndex 
)

Change the position of the specified external events.

◆ MoveExternalLayout()

void gd::Project::MoveExternalLayout ( std::size_t  oldIndex,
std::size_t  newIndex 
)

Change the position of the specified external layout.

◆ MoveLayout()

void gd::Project::MoveLayout ( std::size_t  oldIndex,
std::size_t  newIndex 
)

Change the position of the specified layout.

◆ RemovePlatform()

bool gd::Project::RemovePlatform ( const gd::String platformName)

Remove a platform from the project.

Note
The remove will fail if there is only one platform left.
Returns
true if the platform was removed, false otherwise.

◆ RemoveSourceFile()

void gd::Project::RemoveSourceFile ( const gd::String name)

Remove the specified source file.

◆ SerializeTo()

void gd::Project::SerializeTo ( SerializerElement element) const

Serialize the project.

"Dirty" flag is set to false when serialization is done.

◆ SetAdaptGameResolutionAtRuntime()

void gd::Project::SetAdaptGameResolutionAtRuntime ( bool  adaptGameResolutionAtRuntime_)
inline

Set if the game resolution should be adapted to the window size at runtime.

See also
SetSizeOnStartupMode

◆ SetAntialiasingMode()

void gd::Project::SetAntialiasingMode ( const gd::String antialiasingMode_)
inline

Set the antialiasing mode used by the game ("none" or "MSAA").

◆ SetAntialisingEnabledOnMobile()

void gd::Project::SetAntialisingEnabledOnMobile ( bool  enable)
inline

Set whether antialising is enabled on mobiles or not.

◆ SetCurrentPlatform()

void gd::Project::SetCurrentPlatform ( const gd::String platformName)

Set the platform to be used to edit the project.

Parameters
platformNameThe name of the new current platform. If not found, the current platform won't be changed.

◆ SetFirstLayout()

void gd::Project::SetFirstLayout ( const gd::String name)
inline

Set the first layout of the project.

◆ SetFolderProject()

void gd::Project::SetFolderProject ( bool  enable = true)
inline

Set that the project should be saved as a folder project.

Parameters
enableTrue to flag as a folder project, false to set it as single file project.

◆ SetGameResolutionSize()

void gd::Project::SetGameResolutionSize ( unsigned int  width,
unsigned int  height 
)
inline

Change game's main window default width.

Note
This is only the default width used when creating the main window for the first time. To change the width at runtime, use the functions related to RuntimeScene.renderWindow

◆ SetLastCompilationDirectory()

void gd::Project::SetLastCompilationDirectory ( const gd::String dir)
inline

Called when project file has changed.

◆ SetMaximumFPS()

void gd::Project::SetMaximumFPS ( int  maxFPS_)
inline

Change the default maximum number of frames allowed to be rendered per seconds

◆ SetMinimumFPS()

void gd::Project::SetMinimumFPS ( unsigned int  minFPS_)
inline

Change the default minimum number of frames allowed to be rendered per seconds

◆ SetOrientation()

void gd::Project::SetOrientation ( const gd::String orientation_)
inline

Change the project orientation (in particular when exported with Cordova). This has no effect on desktop and web browsers.

Parameters
orientationThe orientation to use ("default", "landscape", "portrait").

◆ SetPixelsRounding()

void gd::Project::SetPixelsRounding ( bool  enable)
inline

Set pixels rounding option to true or false.

◆ SetPlayableWithGamepad()

void gd::Project::SetPlayableWithGamepad ( bool  playable = true)
inline

Define the project as playable with a gamepad.

Parameters
enableTrue to define the project as playable with a gamepad.

◆ SetPlayableWithKeyboard()

void gd::Project::SetPlayableWithKeyboard ( bool  playable = true)
inline

Define the project as playable with a keyboard.

Parameters
enableTrue to define the project as playable with a keyboard.

◆ SetPlayableWithMobile()

void gd::Project::SetPlayableWithMobile ( bool  playable = true)
inline

Define the project as playable on a mobile.

Parameters
enableTrue to define the project as playable on a mobile.

◆ SetProjectFile()

void gd::Project::SetProjectFile ( const gd::String file)
inline

Called when project file has changed.

◆ SetScaleMode()

void gd::Project::SetScaleMode ( const gd::String scaleMode_)
inline

Set the scale mode used by the game (usually "linear" or "nearest").

◆ SetSizeOnStartupMode()

void gd::Project::SetSizeOnStartupMode ( const gd::String mode)
inline

Set how to adapt the game size to the screen.

Parameters
modeThe size to be used. Can be "adaptWidth", "adaptHeight" or empty fpr no changes to game size.

◆ SetVerticalSyncActivatedByDefault()

void gd::Project::SetVerticalSyncActivatedByDefault ( bool  enable)
inline

Set if vertical synchronization is enabled by default.

◆ SwapEventsFunctionsExtensions()

void gd::Project::SwapEventsFunctionsExtensions ( std::size_t  first,
std::size_t  second 
)

Swap the specified events functions extensions.

Do nothing if indexes are not correct.

◆ SwapExternalEvents()

void gd::Project::SwapExternalEvents ( std::size_t  first,
std::size_t  second 
)

Swap the specified external events.

Do nothing if indexes are not correct.

◆ SwapExternalLayouts()

void gd::Project::SwapExternalLayouts ( std::size_t  first,
std::size_t  second 
)

Swap the specified external layouts.

Do nothing if indexes are not correct.

◆ SwapLayouts()

void gd::Project::SwapLayouts ( std::size_t  first,
std::size_t  second 
)

Swap the specified layouts.

Do nothing if indexes are not correct.

◆ UnserializeAndInsertExtensionsFrom()

void gd::Project::UnserializeAndInsertExtensionsFrom ( const gd::SerializerElement eventsFunctionsExtensionsElement)

Unserialize and insert in the project the extensions.

Unserialization is done in two passe to allow dependencies between extensions.

Note
If an extension with the same name already exists, it will be overwritten.

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