21#ifndef GF_TEXTURE_ATLAS_H
22#define GF_TEXTURE_ATLAS_H
27#include "GraphicsApi.h"
32#ifndef DOXYGEN_SHOULD_SKIP_THIS
37 class ResourceManager;
105 m_texturePath = path;
115 return m_texturePath;
132 m_texture = &texture;
157 return m_texture !=
nullptr;
198 void loadXml(
const Path& filename);
203 std::map<std::string, RectI> m_rects;
206#ifndef DOXYGEN_SHOULD_SKIP_THIS
A resource manager.
Definition: ResourceManager.h:144
A collection of sub-texture.
Definition: TextureAtlas.h:65
const Texture & getTexture() const
Get the source texture of the atlas.
Definition: TextureAtlas.h:145
void setTexture(const Texture &texture)
Change the source texture of the atlas.
Definition: TextureAtlas.h:131
RectI getSubTexture(const std::string &name) const
Get the sub-texture rectangle.
const Path & getTexturePath() const
Get the texture path.
Definition: TextureAtlas.h:114
void addSubTexture(std::string name, const RectI &rect)
Add a sub-texture to the atlas.
TextureAtlas(const Path &filename, ResourceManager &resources)
Load an atlas from a XML file.
void setTexturePath(const Path &path)
Set the texture path.
Definition: TextureAtlas.h:104
bool hasTexture() const
Check if a texture is set.
Definition: TextureAtlas.h:156
TextureAtlas(const Path &filename)
Load an atlas from a XML file.
TextureAtlas()
Default constructor.
Definition: TextureAtlas.h:70
RectF getTextureRect(const std::string &name) const
Get the texture rectangle in normalized coordinates.
void unsetTexture()
Unset the source texture of the atlas.
Definition: TextureAtlas.h:167
A texture for colored images.
Definition: Texture.h:313
std::filesystem::path Path
A path in the filesystem.
Definition: Path.h:40
The namespace for gf classes.