GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | Public Attributes | List of all members

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

#include <Project.h>

Inherits gd::ObjectsContainer.

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...
 
bool IsDirty ()
 Return true if the project is marked as being modified (The IDE or application using the project should ask to save the project if the project is closed).
 
void SetDirty (bool enable=true)
 Mark the project as being modified (The IDE or application using the project should ask to save the project if the project is closed).
 
unsigned int GetLastSaveGDMajorVersion ()
 
unsigned int GetLastSaveGDMinorVersion ()
 
unsigned int GetLastSaveGDBuildVersion ()
 
Common properties

Some properties for the project

void SetName (const gd::String &name_)
 Change project name.
 
const gd::StringGetName () const
 Get project name.
 
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 project version.
 
void SetAuthor (const gd::String &author_)
 Change the author of the project.
 
const gd::StringGetAuthor () const
 Get project author name.
 
void SetPackageName (const gd::String &packageName_)
 Change project package name.
 
const gd::StringGetPackageName () const
 Get project package name.
 
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 project orientation ("default", "landscape", "portrait").
 
void SetAdMobAppId (const gd::String &adMobAppId_)
 Change the project AdMob application ID (needed to use the AdMob extension). This has no effect on desktop and web browsers.
 
const gd::StringGetAdMobAppId () const
 Get the project AdMob application ID.
 
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.
 
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_)
 
const std::vector< gd::String > & GetUsedExtensions () const
 
std::vector< gd::String > & GetUsedExtensions ()
 
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 gd::String &platformName="")
 
gd::BehaviorGetBehavior (const gd::String &type, const gd::String &platformName="")
 
gd::BehaviorsSharedDataGetBehaviorSharedDatas (const gd::String &type, const gd::String &platformName="")
 
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 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)
 Adds a new empty layout called "name" at the specified position in the layout list.
 
gd::LayoutInsertLayout (const Layout &layout, std::size_t position)
 Adds a new layout constructed from the layout passed as parameter. More...
 
void RemoveLayout (const gd::String &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 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)
 
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 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)
 
void SetFirstLayout (const gd::String &name)
 
const gd::StringGetFirstLayout ()
 
Events functions extensions management
bool HasEventsFunctionsExtensionNamed (const gd::String &name) const
 
EventsFunctionsExtensionGetEventsFunctionsExtension (const gd::String &name)
 
const EventsFunctionsExtensionGetEventsFunctionsExtension (const gd::String &name) const
 
EventsFunctionsExtensionGetEventsFunctionsExtension (std::size_t index)
 
const EventsFunctionsExtensionGetEventsFunctionsExtension (std::size_t index) const
 
std::size_t GetEventsFunctionsExtensionPosition (const gd::String &name) const
 
void SwapEventsFunctionsExtensions (std::size_t first, std::size_t second)
 Swap the specified events functions extensions. More...
 
std::size_t GetEventsFunctionsExtensionsCount () const
 
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 RemoveEventsFunctionsExtension (const gd::String &name)
 
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.
 
const std::shared_ptr
< gd::ImageManager > & 
GetImageManager () const
 Provide access to the ImageManager allowing to load SFML or OpenGL textures for the IDE ( or at runtime for the GD C++ Platform ).
 
std::shared_ptr
< gd::ImageManager > & 
GetImageManager ()
 Provide access to the ImageManager allowing to load SFML or OpenGL textures for the IDE ( or at runtime for the GD C++ Platform ).
 
void SetImageManager (std::shared_ptr< gd::ImageManager > imageManager_)
 Provide access to the ImageManager allowing to load SFML or OpenGL textures for the IDE ( or at runtime for the GD C++ Platform ).
 
void ExposeResources (gd::ArbitraryResourceWorker &worker)
 Called ( e.g. during compilation ) so as to inventory internal resources, sometimes update their filename or any other work or resources. More...
 
Variable management

Members functions related to global variables management.

const gd::VariablesContainerGetVariables () const
 
gd::VariablesContainerGetVariables ()
 
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)
 
- Public Member Functions inherited from gd::ObjectsContainer
 ObjectsContainer ()
 Default constructor creating a container without any objects.
 
bool HasObjectNamed (const gd::String &name) const
 Return true if object called name exists.
 
ObjectGetObject (const gd::String &name)
 Return a reference to the object called name.
 
const gd::ObjectGetObject (const gd::String &name) const
 Return a reference to the object called name.
 
ObjectGetObject (std::size_t index)
 Return a reference to the object at position index in the objects list.
 
const gd::ObjectGetObject (std::size_t index) const
 Return a reference to the object at position index in the objects list.
 
std::size_t GetObjectPosition (const gd::String &name) const
 Return the position of the object called name in the objects list. More...
 
std::size_t GetObjectsCount () const
 Return the number of object.
 
gd::ObjectInsertNewObject (gd::Project &project, const gd::String &objectType, const gd::String &name, std::size_t position)
 Add a new empty object of type objectType called name at the specified position in the list.
More...
 
gd::ObjectInsertObject (const gd::Object &object, std::size_t position)
 Add a new object to the list. More...
 
void RemoveObject (const gd::String &name)
 Delete an object. More...
 
void MoveObject (std::size_t oldIndex, std::size_t newIndex)
 
void SwapObjects (std::size_t firstObjectIndex, std::size_t secondObjectIndex)
 Swap the position of the specified objects.
 
void MoveObjectToAnotherContainer (const gd::String &name, gd::ObjectsContainer &newContainer, std::size_t newPosition)
 
std::vector< std::unique_ptr
< gd::Object > > & 
GetObjects ()
 
const std::vector
< std::unique_ptr< gd::Object > > & 
GetObjects () const
 
void SerializeObjectsTo (SerializerElement &element) const
 Serialize instances container.
 
void UnserializeObjectsFrom (gd::Project &project, const SerializerElement &element)
 Unserialize the instances container.
 
ObjectGroupsContainerGetObjectGroups ()
 Return a reference to the project's objects groups.
 
const ObjectGroupsContainerGetObjectGroups () const
 Return a const reference to the project's objects groups.
 

Static Public Member Functions

Other
static bool ValidateObjectName (const gd::String &objectName)
 
static gd::String GetBadObjectNameWarning ()
 

Public Attributes

std::vector< gd::StringimagesChanged
 
gd::String winExecutableFilename
 Windows executable name.
 
gd::String winExecutableIconFile
 Icon for Windows executable.
 
gd::String linuxExecutableFilename
 Linux executable name.
 
gd::String macExecutableFilename
 Mac executable name.
 

Additional Inherited Members

- Protected Attributes inherited from gd::ObjectsContainer
std::vector< std::unique_ptr
< gd::Object > > 
initialObjects
 Objects contained.
 
gd::ObjectGroupsContainer objectGroups
 

Detailed Description

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

Member Function Documentation

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

Add a platform to the project

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.
std::unique_ptr< gd::Object > gd::Project::CreateObject ( const gd::String type,
const gd::String name,
const gd::String platformName = "" 
)

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

Note
A project can use more than one platform. In this case, the first platform supporting the object is used, unless platformName argument is not empty.
It is assumed that each platform provides an equivalent object.
Parameters
typeThe type of the object
nameThe name of the object
platformNameThe name of the platform to be used. If empty, the first platform supporting the object is used.
void gd::Project::ExposeResources ( gd::ArbitraryResourceWorker worker)

Called ( e.g. during compilation ) so as to inventory internal resources, sometimes update their filename or any other work or resources.

See WholeProjectRefactorer for the same thing for events.

See also
WholeProjectRefactorer
ArbitraryResourceWorker
gd::String gd::Project::GetBadObjectNameWarning ( )
static

Return a message that will be displayed when an invalid object name has been entered.

Note
This message will be displayed by the IDE into a tooltip.
gd::Behavior * gd::Project::GetBehavior ( const gd::String type,
const gd::String platformName = "" 
)

Get the behavior of the given type.

Note
A project can use more than one platform. In this case, the first platform supporting the behavior is used, unless platformName argument is not empty. It is assumed that each platform provides an equivalent behavior.
Parameters
typeThe type of the behavior
platformNameThe name of the platform to be used. If empty, the first platform supporting the object is used.
gd::BehaviorsSharedData * gd::Project::GetBehaviorSharedDatas ( const gd::String type,
const gd::String platformName = "" 
)

Get the behavior shared data of the given type.

Note
A project can use more than one platform. In this case, the first platform supporting the behavior shared data is used, unless platformName argument is not empty. It is assumed that each platform provides equivalent behavior shared data.
Parameters
typeThe type of behavior
platformNameThe name of the platform to be used. If empty, the first platform supporting the object is used.
gd::EventsFunctionsExtension & gd::Project::GetEventsFunctionsExtension ( const gd::String name)

Return a reference to the events functions extension called "name".

const gd::EventsFunctionsExtension & gd::Project::GetEventsFunctionsExtension ( const gd::String name) const

Return a reference to the events functions extension called "name".

gd::EventsFunctionsExtension & gd::Project::GetEventsFunctionsExtension ( std::size_t  index)

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

const gd::EventsFunctionsExtension & gd::Project::GetEventsFunctionsExtension ( std::size_t  index) const

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

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

Return the position of the events functions extension called "name" in the list

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

Return the number of events functions extension.

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

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

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

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

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

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

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

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

Return the number of external events.

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

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

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

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

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

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

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

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

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

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

Return the number of external layout.

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

Get the first layout of the project.

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

Return the latest directory used to compile the game

See also
gd::Project::SetLastCompilationDirectory
unsigned int gd::Project::GetLastSaveGDBuildVersion ( )
inline

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

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

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

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

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

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

Get the default number of maximum frame par seconds

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

Get the default number of minimum frame par seconds

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

Return project file

See also
gd::Project::SetProjectFile
const gd::String& gd::Project::GetScaleMode ( ) const
inline

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

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

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

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

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

const std::vector<gd::String>& gd::Project::GetUsedExtensions ( ) const
inline

Return a reference to the vector containing the names of extensions used by the project.

std::vector<gd::String>& gd::Project::GetUsedExtensions ( )
inline

Return a reference to the vector containing the names of extensions used by the project.

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

Return the list of platforms used by the project.

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

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

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

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

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

Return true if events functions extension called "name" exists.

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

Return true if external events called "name" exists.

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

Return true if external layout called "name" exists.

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.
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).
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.
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.
gd::Layout & gd::Project::InsertLayout ( const Layout layout,
std::size_t  position 
)

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

Note
No pointer or reference must be kept on 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.
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.

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

Check if the project is saved as a folder project.

See also
gd::Project::SetFolderProject
bool gd::Project::IsVerticalSynchronizationEnabledByDefault ( ) const
inline

Return true if vertical synchronization is enabled by default.

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

Must delete the events functions extension named "name".

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

Must delete external events named "name".

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

Must delete external layout named "name".

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

Must delete layout named "name".

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.
void gd::Project::RemoveSourceFile ( const gd::String name)

Remove the specified source file.

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

Serialize the project.

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

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

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

See also
SetSizeOnStartupMode
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.
void gd::Project::SetFirstLayout ( const gd::String name)
inline

Set the first layout of the project.

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.
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
void gd::Project::SetLastCompilationDirectory ( const gd::String dir)
inline

Called when project file has changed.

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

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

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

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

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").
void gd::Project::SetProjectFile ( const gd::String file)
inline

Called when project file has changed.

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

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

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.
void gd::Project::SetVerticalSyncActivatedByDefault ( bool  enable)
inline

Set if vertical synchronization is enabled by default.

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.

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

Swap the specified external events.

Do nothing if indexes are not correct.

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

Swap the specified external layouts.

Do nothing if indexes are not correct.

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

Swap the specified layouts.

Do nothing if indexes are not correct.

bool gd::Project::ValidateObjectName ( const gd::String objectName)
static

Return true if objectName can be used as name for an object.

Default implementation check if objectName is only composed of a-z,A-Z,0-9 or _ characters an if does not conflict with an expression.

Member Data Documentation

std::vector<gd::String> gd::Project::imagesChanged

Images that have been changed and which have to be reloaded


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