21 #ifndef GF_TEXTURE_ATLAS_H 22 #define GF_TEXTURE_ATLAS_H 32 #ifndef DOXYGEN_SHOULD_SKIP_THIS 107 m_texturePath = path;
117 return m_texturePath;
134 m_texture = &texture;
159 return m_texture !=
nullptr;
202 std::map<std::string, RectU> m_rects;
205 #ifndef DOXYGEN_SHOULD_SKIP_THIS A collection of sub-texture.
Definition: TextureAtlas.h:65
bool loadFromFile(const Path &filename, ResourceManager &resources)
Load an atlas from a XML file.
void setTexture(const Texture &texture)
Change the source texture of the atlas.
Definition: TextureAtlas.h:133
const Path & getTexturePath() const
Get the texture path.
Definition: TextureAtlas.h:116
A texture for colored images.
Definition: Texture.h:339
TextureAtlas()
Default constructor.
Definition: TextureAtlas.h:70
The namespace for gf classes.
Definition: Action.h:34
void addSubTexture(std::string name, const RectU &rect)
Add a sub-texture to the atlas.
A resource manager.
Definition: ResourceManager.h:131
const Texture & getTexture() const
Get the source texture of the atlas.
Definition: TextureAtlas.h:147
bool hasTexture() const
Check if a texture is set.
Definition: TextureAtlas.h:158
RectF getTextureRect(const std::string &name) const
Get the texture rectangle in normalized coordinates.
#define GF_API
Definition: Portability.h:35
RectU getSubTexture(const std::string &name) const
Get the sub-texture rectangle.
void setTexturePath(const Path &path)
Set the texture path.
Definition: TextureAtlas.h:106
bool loadFromFile(const Path &filename)
Load an atlas from a XML file.
void unsetTexture()
Unset the source texture of the atlas.
Definition: TextureAtlas.h:169