GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
Base class used to represent an object configuration. For example, this can be the animations in a sprite, the text, its font, its color in a Text object, etc... More...
#include <ObjectConfiguration.h>
Inherited by gd::CustomObjectConfiguration, and gd::SpriteObject.
Public Member Functions | |
ObjectConfiguration () | |
virtual | ~ObjectConfiguration () |
virtual std::unique_ptr< gd::ObjectConfiguration > | Clone () const |
void | SetType (const gd::String &type_) |
Change the type of the object. | |
const gd::String & | GetType () const |
Return the type of the object. | |
Object properties | |
Reading and updating object configuration properties | |
virtual std::map< gd::String, gd::PropertyDescriptor > | GetProperties () const |
Called when the IDE wants to know about the custom properties of the object configuration. More... | |
virtual bool | UpdateProperty (const gd::String &name, const gd::String &value) |
Called when the IDE wants to update a custom property of the object configuration. More... | |
Drawing and editing initial instances | |
Members functions related to drawing and editing initial instances of this object configuration | |
virtual std::map< gd::String, gd::PropertyDescriptor > | GetInitialInstanceProperties (const gd::InitialInstance &instance) |
Called when the IDE wants to know about the custom properties of an initial instance of this object configuration. More... | |
virtual bool | UpdateInitialInstanceProperty (gd::InitialInstance &instance, const gd::String &name, const gd::String &value) |
Called when the IDE wants to update a custom property of an initial instance of this object configuration. More... | |
Resources management | |
Members functions related to managing resources used by the object configuration | |
virtual void | ExposeResources (gd::ArbitraryResourceWorker &worker) |
Called ( e.g. during compilation ) so as to inventory internal resources and sometimes update their filename. Implementation example: More... | |
Serialization | |
Members functions related to serialization of the object configuration | |
void | SerializeTo (SerializerElement &element) const |
Serialize the object configuration. More... | |
void | UnserializeFrom (gd::Project &project, const SerializerElement &element) |
Unserialize the object configuration. More... | |
Animations | |
Members functions related to object animations | |
virtual size_t | GetAnimationsCount () const |
Return the number of animations declared in this object configuration. | |
virtual const gd::String & | GetAnimationName (size_t index) const |
Return the name of an animation declared in this object configuration. | |
virtual bool | HasAnimationNamed (const gd::String &animationName) const |
Return true if an animation is declared in this object configuration for a given name. | |
Protected Member Functions | |
virtual void | DoUnserializeFrom (gd::Project &project, const SerializerElement &element) |
Derived object configuration can redefine this method to load custom attributes. | |
virtual void | DoSerializeTo (SerializerElement &element) const |
Derived object configuration can redefine this method to save custom attributes. | |
Protected Attributes | |
gd::String | type |
Base class used to represent an object configuration. For example, this can be the animations in a sprite, the text, its font, its color in a Text object, etc...
gd::ObjectConfiguration::ObjectConfiguration | ( | ) |
Create a new object configuration.
|
virtual |
Destructor.
|
inlinevirtual |
Must return a pointer to a copy of the configuration. This method is needed to do polymorphic copies. Just redefine this method in your derived object class like this:
Reimplemented in gd::CustomObjectConfiguration, and gd::SpriteObject.
|
inlinevirtual |
Called ( e.g. during compilation ) so as to inventory internal resources and sometimes update their filename. Implementation example:
Reimplemented in gd::CustomObjectConfiguration, and gd::SpriteObject.
|
virtual |
Called when the IDE wants to know about the custom properties of an initial instance of this object configuration.
Reimplemented in gd::SpriteObject, and gd::CustomObjectConfiguration.
|
virtual |
Called when the IDE wants to know about the custom properties of the object configuration.
Usage example:
Reimplemented in gd::CustomObjectConfiguration, and gd::SpriteObject.
void gd::ObjectConfiguration::SerializeTo | ( | SerializerElement & | element | ) | const |
Serialize the object configuration.
void gd::ObjectConfiguration::UnserializeFrom | ( | gd::Project & | project, |
const SerializerElement & | element | ||
) |
Unserialize the object configuration.
|
inlinevirtual |
Called when the IDE wants to update a custom property of an initial instance of this object configuration.
Reimplemented in gd::SpriteObject, and gd::CustomObjectConfiguration.
|
inlinevirtual |
Called when the IDE wants to update a custom property of the object configuration.
Reimplemented in gd::CustomObjectConfiguration, and gd::SpriteObject.
|
protected |
Which type of object is represented by this configuration.