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
gd::ImageResource Class Reference

Describe an image/texture used by a project. More...

#include <ResourcesManager.h>

Inherits gd::Resource.

Public Member Functions

virtual ImageResourceClone () const override
 
virtual const gd::StringGetFile () const override
 
virtual void SetFile (const gd::String &newFile) override
 
virtual bool UseFile () override
 Return true if the resource use a file. More...
 
std::map< gd::String,
gd::PropertyDescriptor
GetProperties (gd::Project &project) const override
 Called when the IDE wants to know about the custom properties of the resource. More...
 
bool UpdateProperty (const gd::String &name, const gd::String &value, gd::Project &project) override
 Called when the IDE wants to update a custom property of the resource. More...
 
void SerializeTo (SerializerElement &element) const override
 Serialize the object.
 
void UnserializeFrom (const SerializerElement &element) override
 Unserialize the objectt.
 
bool IsSmooth () const
 Return true if the image should be smoothed.
 
void SetSmooth (bool enable=true)
 Set if the image should be smoothed in game.
 
- Public Member Functions inherited from gd::Resource
virtual void SetName (const gd::String &name_)
 Change the name of the resource with the name passed as parameter.
 
virtual const gd::StringGetName () const
 Return the name of the resource.
 
virtual void SetKind (const gd::String &newKind)
 Change the kind of the resource.
 
virtual const gd::StringGetKind () const
 Return the kind of the resource.
 
virtual void SetUserAdded (bool isUserAdded)
 Change if the resource is user added or not.
 
virtual bool IsUserAdded () const
 Return true if the resource was added by the user.
 
virtual void SetMetadata (const gd::String &metadata_)
 Set the metadata (any string) associated to the resource. More...
 
virtual const gd::StringGetMetadata () const
 Return the (optional) metadata associated to the resource.
 

Public Attributes

bool smooth
 True if smoothing filter is applied.
 
bool alwaysLoaded
 True if the image must always be loaded in memory.
 

Detailed Description

Describe an image/texture used by a project.

See also
Resource

Member Function Documentation

virtual const gd::String& gd::ImageResource::GetFile ( ) const
inlineoverridevirtual

Return the file used by the resource.

Reimplemented from gd::Resource.

std::map< gd::String, gd::PropertyDescriptor > gd::ImageResource::GetProperties ( gd::Project project) const
overridevirtual

Called when the IDE wants to know about the custom properties of the resource.

Usage example:

std::map<gd::String, gd::PropertyDescriptor> properties;
properties[ToString(_("Text"))].SetValue("Hello world!");
return properties;
Returns
a std::map with properties names as key.
See also
gd::PropertyDescriptor

Reimplemented from gd::Resource.

void gd::ImageResource::SetFile ( const gd::String newFile)
overridevirtual

Change the file of the resource.

Reimplemented from gd::Resource.

bool gd::ImageResource::UpdateProperty ( const gd::String name,
const gd::String value,
gd::Project project 
)
overridevirtual

Called when the IDE wants to update a custom property of the resource.

Returns
false if the new value cannot be set

Reimplemented from gd::Resource.

virtual bool gd::ImageResource::UseFile ( )
inlineoverridevirtual

Return true if the resource use a file.

See also
gd::Resource::GetFile
gd::Resource::SetFile

Reimplemented from gd::Resource.


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