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

Contains the layers for a scene or a custom object. More...

#include <LayersContainer.h>

Public Member Functions

bool HasLayerNamed (const gd::String &name) const
 Return true if the layer called "name" exists.
 
LayerGetLayer (const gd::String &name)
 Return a reference to the layer called "name".
 
const LayerGetLayer (const gd::String &name) const
 Return a reference to the layer called "name".
 
LayerGetLayer (std::size_t index)
 Return a reference to the layer at position "index" in the layers list.
 
const LayerGetLayer (std::size_t index) const
 Return a reference to the layer at position "index" in the layers list.
 
std::size_t GetLayerPosition (const gd::String &name) const
 Return the position of the layer called "name" in the layers list.
 
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)
 
void Reset ()
 
void SerializeLayersTo (SerializerElement &element) const
 Serialize the layers.
 
void UnserializeLayersFrom (const SerializerElement &element)
 Unserialize the layers.
 

Detailed Description

Contains the layers for a scene or a custom object.

Member Function Documentation

◆ GetLayersCount()

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

The number of layers.

◆ InsertLayer()

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

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

Parameters
theLayerThe layer that must be copied and inserted.
positionInsertion position.

◆ InsertNewLayer()

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

Add a new empty the layer sheet called "name" at the specified position in the layers list.

◆ MoveLayer()

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

Change the position of the specified layer.

◆ RemoveLayer()

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

Delete the layer named "name".

◆ SwapLayers()

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

Swap the position of the specified layers.


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