.. index:: pair: class; EE::Graphics::TextureAtlasManager .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager: class EE::Graphics::TextureAtlasManager ======================================= .. toctree:: :hidden: Overview ~~~~~~~~ The :ref:`Texture ` Atlas Manager is a singleton class that manages all the instances of :ref:`Texture ` Atlases instanciated. Releases the :ref:`Texture ` Atlases instances automatically. So the user doesn't need to release any :ref:`Texture ` Atlas instance. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class TextureAtlasManager: public :ref:`EE::System::ResourceManagerMulti` { public: // construction virtual :target:`~TextureAtlasManager`(); // methods :ref:`TextureAtlas`* :ref:`loadFromFile`(const std::string& TextureAtlasPath); :ref:`TextureAtlas`* :ref:`loadFromStream`(:ref:`IOStream`& IOS); :ref:`TextureAtlas`* :ref:`loadFromMemory`(const :ref:`Uint8`* Data, const :ref:`Uint32`& DataSize, const std::string& TextureAtlasName); :ref:`TextureAtlas`* :ref:`loadFromPack`(:ref:`Pack`* Pack, const std::string& FilePackPath); :ref:`TextureRegion`* :ref:`getTextureRegionByName`(const std::string& Name); :ref:`TextureRegion`* :ref:`getTextureRegionById`(const :ref:`String::HashType`& Id); std::vector<:ref:`TextureRegion`*> :ref:`getTextureRegionsByPattern`(const std::string& name, const std::string& extension = "", :ref:`TextureAtlas`* SearchInTextureAtlas = NULL); std::vector<:ref:`TextureRegion`*> :ref:`getTextureRegionsByPatternId`(const :ref:`Uint32`& TextureRegionId, const std::string& extension = "", :ref:`TextureAtlas`* SearchInTextureAtlas = NULL); void :ref:`printResources`(); void :ref:`setPrintWarnings`(const bool& warn); const bool& :ref:`getPrintWarnings`() const; }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods virtual T* :ref:`add`(T* resource); bool :ref:`remove`(T* resource, bool remove = true); bool :ref:`removeById`(const :ref:`String::HashType`& id, bool remove = true); bool :ref:`removeByName`(const std::string& name, bool remove = true); T* :ref:`getByName`(const std::string& name); T* :ref:`getById`(const :ref:`String::HashType`& id); :ref:`Uint32` :ref:`getCount`(); :ref:`Uint32` :ref:`getCount`(const std::string& name); :ref:`Uint32` :ref:`getCount`(const :ref:`String::HashType`& id); bool :ref:`exists`(const std::string& name); bool :ref:`existsId`(const :ref:`String::HashType`& id); void :ref:`destroy`(); void :ref:`printNames`(); std::unordered_multimap<:ref:`String::HashType`, T*>& :ref:`getResources`(); const bool& :ref:`isDestroying`() const; .. _details-class_e_e_1_1_graphics_1_1_texture_atlas_manager: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ The :ref:`Texture ` Atlas Manager is a singleton class that manages all the instances of :ref:`Texture ` Atlases instanciated. Releases the :ref:`Texture ` Atlases instances automatically. So the user doesn't need to release any :ref:`Texture ` Atlas instance. Methods ------- .. index:: pair: function; loadFromFile .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1a2d25bca257381677d223fc3b13d25023: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`TextureAtlas`* loadFromFile(const std::string& TextureAtlasPath) Loads a texture atlas from its path ( the texture atlas binary is expected, not the texture, the ".eta" file ). .. index:: pair: function; loadFromStream .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1acf910b9abef42b3704a0893feddaff3b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`TextureAtlas`* loadFromStream(:ref:`IOStream`& IOS) Loads a texture atlas from a io stream. .. index:: pair: function; loadFromMemory .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1a9cda96af18ef9660dfb9216b4b01d9c5: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`TextureAtlas`* loadFromMemory(const :ref:`Uint8`* Data, const :ref:`Uint32`& DataSize, const std::string& TextureAtlasName) Loads a texture atlas from memory. .. index:: pair: function; loadFromPack .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1a229ea689b748578310b440dc1bc2d087: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`TextureAtlas`* loadFromPack(:ref:`Pack`* Pack, const std::string& FilePackPath) Loads a texture atlas from a pack file. .. index:: pair: function; getTextureRegionByName .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1a0eb77f17a9c99699ce01e543646e3178: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`TextureRegion`* getTextureRegionByName(const std::string& Name) It will search for a :ref:`TextureRegion ` Name in the texture atlases loaded. .. rubric:: Returns: The first :ref:`TextureRegion ` found with the given name in any atlas. .. index:: pair: function; getTextureRegionById .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1ab1f8db05db7fa74fc8828024c02c820a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`TextureRegion`* getTextureRegionById(const :ref:`String::HashType`& Id) It will search for a :ref:`TextureRegion ` Id in the texture atlases loaded. .. rubric:: Returns: The first :ref:`TextureRegion ` found with the given id in any atlas. .. index:: pair: function; getTextureRegionsByPattern .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1acabb39067a1f952bcfb763f6f0f51638: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`TextureRegion`*> getTextureRegionsByPattern(const std::string& name, const std::string& extension = "", :ref:`TextureAtlas`* SearchInTextureAtlas = NULL) Search for a pattern name For example search for name "car" with extensions "png", i will try to find car00.png car01.png car02.png, and so on, it will continue if find something, otherwise it will stop ( it will always search at least for car00.png and car01.png ) .. note:: :ref:`Texture ` atlases saves the TextureRegions names without extension by default. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - name - First part of the sub texture name * - extension - Extension of the sub texture name ( if have one, otherwise is empty ) * - SearchInTextureAtlas - If you want only to search in a especific atlas ( NULL if you want to search in all atlases ) .. index:: pair: function; getTextureRegionsByPatternId .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1a831ac82ef22cd0cd4046147747860fde: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector<:ref:`TextureRegion`*> getTextureRegionsByPatternId(const :ref:`Uint32`& TextureRegionId, const std::string& extension = "", :ref:`TextureAtlas`* SearchInTextureAtlas = NULL) Search for a pattern id. This will look for the :ref:`TextureRegion ` with the id passed, and it will try to find any pattern by the :ref:`TextureRegion ` name. .. rubric:: See also: GetTextureRegionsByPattern .. index:: pair: function; printResources .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1a588439d6710791e9e01b59a94b799d1d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void printResources() Prints all the resources name to the screen. .. index:: pair: function; setPrintWarnings .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1a1bcfa83843c5c1884e1bb173ab63ae46: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPrintWarnings(const bool& warn) Sets if the warnings for not finding a resource must be printed in screen. .. index:: pair: function; getPrintWarnings .. _doxid-class_e_e_1_1_graphics_1_1_texture_atlas_manager_1a2718801a10b1c8467b3f118797c5112d: .. ref-code-block:: cpp :class: doxyrest-title-code-block const bool& getPrintWarnings() const .. rubric:: Returns: If warnings are being printed.