7 #ifndef NAZARA_TEXTSPRITE_HPP 8 #define NAZARA_TEXTSPRITE_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Graphics/Material.hpp> 12 #include <Nazara/Graphics/InstancedRenderable.hpp> 13 #include <Nazara/Utility/AbstractAtlas.hpp> 14 #include <Nazara/Utility/VertexStruct.hpp> 18 class AbstractTextDrawer;
21 using TextSpriteConstRef = ObjectRef<const TextSprite>;
22 using TextSpriteLibrary = ObjectLibrary<TextSprite>;
23 using TextSpriteRef = ObjectRef<TextSprite>;
29 inline TextSprite(
const AbstractTextDrawer& drawer);
33 void AddToRenderQueue(
AbstractRenderQueue* renderQueue,
const InstanceData& instanceData)
const override;
37 inline const Color& GetColor()
const;
38 inline float GetScale()
const;
40 inline void SetColor(
const Color& color);
41 inline void SetDefaultMaterial();
43 inline void SetMaterial(std::size_t skinIndex,
MaterialRef material);
44 inline void SetScale(
float scale);
46 void Update(
const AbstractTextDrawer& drawer);
50 template<
typename... Args>
static TextSpriteRef New(Args&&... args);
53 inline void InvalidateVertices();
54 void MakeBoundingVolume()
const override;
55 void OnAtlasInvalidated(
const AbstractAtlas* atlas);
56 void OnAtlasLayerChange(
const AbstractAtlas* atlas, AbstractImage* oldLayer, AbstractImage* newLayer);
57 void UpdateData(InstanceData* instanceData)
const override;
68 NazaraSlot(AbstractAtlas, OnAtlasCleared, clearSlot);
69 NazaraSlot(AbstractAtlas, OnAtlasLayerChange, layerChangeSlot);
70 NazaraSlot(AbstractAtlas, OnAtlasRelease, releaseSlot);
73 std::unordered_map<const AbstractAtlas*, AtlasSlots> m_atlases;
74 mutable std::unordered_map<Texture*, RenderIndices> m_renderInfos;
75 mutable std::vector<VertexStruct_XY_Color_UV> m_localVertices;
80 static TextSpriteLibrary::LibraryMap s_library;
84 #include <Nazara/Graphics/TextSprite.inl> 86 #endif // NAZARA_TEXTSPRITE_HPP Core class that represents a color.
Definition: Color.hpp:18
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the rendering queue for our scene.
Definition: AbstractRenderQueue.hpp:26
Graphics class that represents an instancer renderable.
Definition: InstancedRenderable.hpp:30
Graphics class that represents the rendering of a sprite containing text.
Definition: TextSprite.hpp:25