Game Develop Core: gd::ImageResource Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups 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>`

Inheritance diagram for gd::ImageResource:
[legend]

## Public Member Functions

virtual ImageResource * | Clone () const
virtual std::string & | GetFile ()
virtual const std::string & | GetFile () const
virtual bool | UseFile ()
| Return true if the resource use a file. More...
virtual void | RenderPreview (wxPaintDC &dc, wxPanel &previewPanel, gd::Project &game)
virtual bool | EditProperty (gd::Project &project, const std::string &property)
virtual bool | ChangeProperty (gd::Project &project, const std::string &property, const std::string &newValue)
virtual std::string | GetProperty (gd::Project &project, const std::string &property)
virtual void | GetPropertyInformation (gd::Project &project, const std::string &property, std::string &userFriendlyName, std::string &description) const
virtual std::vector< std::string > | GetAllProperties (gd::Project &project) const
virtual void | SaveToXml (TiXmlElement *elem) const
virtual void | LoadFromXml (const TiXmlElement *elem)
Public Member Functions inherited from gd::Resource
virtual void | SetName (const std::string &name_)
| Change the name of the resource with the name passed as parameter.
virtual const std::string & | GetName () const
| Return the name of the resource.
virtual void | SetKind (const std::string &newKind)
| Change the kind of the resource.
virtual const std::string & | GetKind () const
| Return the name of the object.
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.
std::string | GetAbsoluteFile (const gd::Project &game) const
| Return, if applicable, a string containing the absolute filename of 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

bool gd::ImageResource::ChangeProperty | ( | gd::Project & | project,
|  | const std::string & | property,
|  | const std::string & | newValue
| ) |  |

virtual

Called when a property must be changed ( i.e: its value was changed in the property grid )

Returns
  true if the resource was changed

Reimplemented from gd::Resource.

bool gd::ImageResource::EditProperty | ( | gd::Project & | project,
|  | const std::string & | property
| ) |  |

virtual

Called when a property must be edited ( i.e: it was double clicked )

Returns
  true if the resource was changed

Reimplemented from gd::Resource.

std::vector< std::string > gd::ImageResource::GetAllProperties | ( | gd::Project & | project) |  | const

virtual

Return a vector containing the name of all the properties of the resource

Reimplemented from gd::Resource.

virtual std::string& gd::ImageResource::GetFile | ( | ) |  |

inlinevirtual

Return the file used by the resource.

Reimplemented from gd::Resource.

virtual const std::string& gd::ImageResource::GetFile | ( | ) |  | const

inlinevirtual

Return the file used by the resource.

Reimplemented from gd::Resource.

std::string gd::ImageResource::GetProperty | ( | gd::Project & | project,
|  | const std::string & | property
| ) |  |

virtual

Called when a property must be changed ( i.e: its value was changed in the property grid )

Returns
  the value of the property

Reimplemented from gd::Resource.

void gd::ImageResource::GetPropertyInformation | ( | gd::Project & | project,
|  | const std::string & | property,
|  | std::string & | userFriendlyName,
|  | std::string & | description
| ) |  | const

virtual

Return a description of the main property provided by the resource ( Example : "Image file" )

Reimplemented from gd::Resource.

void gd::ImageResource::LoadFromXml | ( | const TiXmlElement * | elem) |  |

virtual

Load from an xml element.

Reimplemented from gd::Resource.

void gd::ImageResource::RenderPreview | ( | wxPaintDC & | dc,
|  | wxPanel & | previewPanel,
|  | gd::Project & | game
| ) |  |

virtual

Called when the resource must be rendered in a preview panel.

Reimplemented from gd::Resource.

void gd::ImageResource::SaveToXml | ( | TiXmlElement * | elem) |  | const

virtual

Save to an xml element.

Reimplemented from gd::Resource.

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

inlinevirtual

Return true if the resource use a file.

See Also
  GetFile

Reimplemented from gd::Resource.

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

- ResourcesManager.h
- ResourcesManager.cpp