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

Represent a layout ( also called a scene ) of a project. More...

#include <Layout.h>

Public Member Functions

 Layout (const Layout &)
 
Layoutoperator= (const Layout &rhs)
 
LayoutClone () const
 Return a pointer to a copy of the layout.
 
void UpdateBehaviorsSharedData (gd::Project &project)
 
std::vector< gd::StringGetAllBehaviorSharedDataNames () const
 Get the names of all shared data stored for behaviors.
 
bool HasBehaviorSharedData (const gd::String &behaviorName)
 Check if shared data are stored for a behavior.
 
const gd::BehaviorsSharedDataGetBehaviorSharedData (const gd::String &behaviorName) const
 Get the shared data stored for a behavior.
 
gd::BehaviorsSharedDataGetBehaviorSharedData (const gd::String &behaviorName)
 Get the shared data stored for a behavior.
 
const std::map< gd::String, std::unique_ptr< gd::BehaviorsSharedData > > & GetAllBehaviorSharedData () const
 Get a map of all shared data stored for behaviors.
 
const gd::EditorSettingsGetAssociatedEditorSettings () const
 
gd::EditorSettingsGetAssociatedEditorSettings ()
 
Common properties

Members functions related to common properties of layouts

void SetName (const gd::String &name_)
 
const gd::StringGetName () const
 
const gd::StringGetMangledName () const
 
void SetBackgroundColor (unsigned int r, unsigned int g, unsigned int b)
 
unsigned int GetBackgroundColorRed () const
 
unsigned int GetBackgroundColorGreen () const
 
unsigned int GetBackgroundColorBlue () const
 
const gd::StringGetWindowDefaultTitle () const
 
void SetWindowDefaultTitle (const gd::String &title_)
 
Layout's objects
gd::ObjectsContainerGetObjects ()
 return the objects of the scene.
 
const gd::ObjectsContainerGetObjects () const
 Return the objects of the scene.
 
Layout's initial instances

Members functions related to initial instances of objects created at the layout start up

const gd::InitialInstancesContainerGetInitialInstances () const
 
gd::InitialInstancesContainerGetInitialInstances ()
 
Layout's events

Members functions related to events management.

const gd::EventsListGetEvents () const
 
gd::EventsListGetEvents ()
 
Variable management

Members functions related to layout variables management.

const gd::VariablesContainerGetVariables () const
 Get the variables of the scene. More...
 
gd::VariablesContainerGetVariables ()
 Get the variables of the scene. More...
 
Layers
const gd::LayersContainerGetLayers () const
 Get the layers of the scene.
 
gd::LayersContainerGetLayers ()
 Get the layers of the scene.
 
bool HasLayerNamed (const gd::String &name) const
 
LayerGetLayer (const gd::String &name)
 
const LayerGetLayer (const gd::String &name) const
 
LayerGetLayer (std::size_t index)
 
const LayerGetLayer (std::size_t index) const
 
std::size_t GetLayerPosition (const gd::String &name) const
 
std::size_t GetLayersCount () const
 
void InsertNewLayer (const gd::String &name, std::size_t position)
 
void InsertLayer (const Layer &theLayer, std::size_t position)
 
void RemoveLayer (const gd::String &name)
 
void SwapLayers (std::size_t firstLayerIndex, std::size_t secondLayerIndex)
 
void MoveLayer (std::size_t oldIndex, std::size_t newIndex)
 
Other properties
void DisableInputWhenFocusIsLost (bool disable=true)
 
bool IsInputDisabledWhenFocusIsLost ()
 
void SetStandardSortMethod (bool enable=true)
 
bool StandardSortMethod () const
 
void SetStopSoundsOnStartup (bool enable=true)
 
bool StopSoundsOnStartup () const
 
Saving and loading

Members functions related to saving and loading the object.

void SerializeTo (SerializerElement &element) const
 Serialize the layout.
 
void UnserializeFrom (gd::Project &project, const SerializerElement &element)
 Unserialize the layout.
 

Detailed Description

Represent a layout ( also called a scene ) of a project.

Member Function Documentation

◆ DisableInputWhenFocusIsLost()

void gd::Layout::DisableInputWhenFocusIsLost ( bool  disable = true)
inline

Set if the input must be disabled when window lose focus.

◆ GetAssociatedEditorSettings() [1/2]

gd::EditorSettings& gd::Layout::GetAssociatedEditorSettings ( )
inline

Return the settings associated to the layout.

See also
gd::EditorSettings

◆ GetAssociatedEditorSettings() [2/2]

const gd::EditorSettings& gd::Layout::GetAssociatedEditorSettings ( ) const
inline

Return the settings associated to the layout.

See also
gd::EditorSettings

◆ GetBackgroundColorBlue()

unsigned int gd::Layout::GetBackgroundColorBlue ( ) const
inline

Get the background color blue component

◆ GetBackgroundColorGreen()

unsigned int gd::Layout::GetBackgroundColorGreen ( ) const
inline

Get the background color green component

◆ GetBackgroundColorRed()

unsigned int gd::Layout::GetBackgroundColorRed ( ) const
inline

Get the background color red component

◆ GetEvents() [1/2]

gd::EventsList& gd::Layout::GetEvents ( )
inline

Get the events of the layout

◆ GetEvents() [2/2]

const gd::EventsList& gd::Layout::GetEvents ( ) const
inline

Get the events of the layout

◆ GetInitialInstances() [1/2]

gd::InitialInstancesContainer& gd::Layout::GetInitialInstances ( )
inline

Return the container storing initial instances.

◆ GetInitialInstances() [2/2]

const gd::InitialInstancesContainer& gd::Layout::GetInitialInstances ( ) const
inline

Return the container storing initial instances.

◆ GetLayer() [1/4]

gd::Layer & gd::Layout::GetLayer ( const gd::String name)

◆ GetLayer() [2/4]

const gd::Layer & gd::Layout::GetLayer ( const gd::String name) const

◆ GetLayer() [3/4]

gd::Layer & gd::Layout::GetLayer ( std::size_t  index)

◆ GetLayer() [4/4]

const gd::Layer & gd::Layout::GetLayer ( std::size_t  index) const

◆ GetLayerPosition()

std::size_t gd::Layout::GetLayerPosition ( const gd::String name) const

◆ GetLayersCount()

std::size_t gd::Layout::GetLayersCount ( ) const

◆ GetMangledName()

const gd::String& gd::Layout::GetMangledName ( ) const
inline

Return the name of the layout mangled by SceneNameMangler.

◆ GetName()

const gd::String& gd::Layout::GetName ( ) const
inline

Return the name of the layout.

◆ GetVariables() [1/2]

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

Get the variables of the scene.

See also
gd::VariablesContainer

◆ GetVariables() [2/2]

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

Get the variables of the scene.

See also
gd::VariablesContainer

◆ GetWindowDefaultTitle()

const gd::String& gd::Layout::GetWindowDefaultTitle ( ) const
inline

Get scene window default title

◆ HasLayerNamed()

bool gd::Layout::HasLayerNamed ( const gd::String name) const

◆ InsertLayer()

void gd::Layout::InsertLayer ( const Layer theLayer,
std::size_t  position 
)

◆ InsertNewLayer()

void gd::Layout::InsertNewLayer ( const gd::String name,
std::size_t  position 
)

◆ IsInputDisabledWhenFocusIsLost()

bool gd::Layout::IsInputDisabledWhenFocusIsLost ( )
inline

Return true if the input must be disabled when window lost focus.

◆ MoveLayer()

void gd::Layout::MoveLayer ( std::size_t  oldIndex,
std::size_t  newIndex 
)

◆ RemoveLayer()

void gd::Layout::RemoveLayer ( const gd::String name)

◆ SetBackgroundColor()

void gd::Layout::SetBackgroundColor ( unsigned int  r,
unsigned int  g,
unsigned int  b 
)
inline

Set the background color

◆ SetName()

void gd::Layout::SetName ( const gd::String name_)

Change the name of the layout with the name passed as parameter.

◆ SetStandardSortMethod()

void gd::Layout::SetStandardSortMethod ( bool  enable = true)
inline

Set if the objects z-order are sorted using the standard method

◆ SetStopSoundsOnStartup()

void gd::Layout::SetStopSoundsOnStartup ( bool  enable = true)
inline

Set if the scene must stop all the sounds being played when it is launched.

◆ SetWindowDefaultTitle()

void gd::Layout::SetWindowDefaultTitle ( const gd::String title_)
inline

Set scene window default title

◆ StandardSortMethod()

bool gd::Layout::StandardSortMethod ( ) const
inline

Return true if the objects z-order are sorted using the standard method

◆ StopSoundsOnStartup()

bool gd::Layout::StopSoundsOnStartup ( ) const
inline

Return true if the scene must stop all the sounds being played when it is launched

◆ SwapLayers()

void gd::Layout::SwapLayers ( std::size_t  firstLayerIndex,
std::size_t  secondLayerIndex 
)

◆ UpdateBehaviorsSharedData()

void gd::Layout::UpdateBehaviorsSharedData ( gd::Project project)

This ensures that the scene had an instance of shared data for every behavior of every object that can be used on the scene (i.e. the objects of the scene and the global objects)

Must be called when a behavior have been added/deleted or when a scene have been added to a project.


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