7 #ifndef NAZARA_SPRITE_HPP 8 #define NAZARA_SPRITE_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Graphics/InstancedRenderable.hpp> 12 #include <Nazara/Graphics/Material.hpp> 19 using SpriteConstRef = ObjectRef<const Sprite>;
20 using SpriteLibrary = ObjectLibrary<Sprite>;
21 using SpriteRef = ObjectRef<Sprite>;
31 inline Sprite(Texture* texture);
36 void AddToRenderQueue(
AbstractRenderQueue* renderQueue,
const InstanceData& instanceData)
const override;
38 inline const Color& GetColor()
const;
39 inline const Color& GetCornerColor(RectCorner corner)
const;
40 inline const Vector3f& GetOrigin()
const;
41 inline const Vector2f& GetSize()
const;
42 inline const Rectf& GetTextureCoords()
const;
44 inline void SetColor(
const Color& color);
45 inline void SetCornerColor(RectCorner corner,
const Color& color);
46 inline void SetDefaultMaterial();
47 inline void SetMaterial(
MaterialRef material,
bool resizeSprite =
true);
48 bool SetMaterial(
String materialName,
bool resizeSprite =
true);
49 inline void SetMaterial(std::size_t skinIndex,
MaterialRef material,
bool resizeSprite =
true);
50 bool SetMaterial(std::size_t skinIndex,
String materialName,
bool resizeSprite =
true);
51 inline void SetOrigin(
const Vector3f& origin);
52 inline void SetSize(
const Vector2f& size);
53 inline void SetSize(
float sizeX,
float sizeY);
54 bool SetTexture(
String textureName,
bool resizeSprite =
true);
55 inline void SetTexture(
TextureRef texture,
bool resizeSprite =
true);
56 bool SetTexture(std::size_t skinIndex,
String textureName,
bool resizeSprite =
true);
57 inline void SetTexture(std::size_t skinIndex,
TextureRef texture,
bool resizeSprite =
true);
58 inline void SetTextureCoords(
const Rectf& coords);
59 inline void SetTextureRect(
const Rectui& rect);
64 template<
typename... Args>
static SpriteRef New(Args&&... args);
67 inline void InvalidateVertices();
68 void MakeBoundingVolume()
const override;
69 void UpdateData(InstanceData* instanceData)
const override;
71 static bool Initialize();
72 static void Uninitialize();
74 std::array<Color, 4> m_cornerColor;
76 Rectf m_textureCoords;
80 static SpriteLibrary::LibraryMap s_library;
84 #include <Nazara/Graphics/Sprite.inl> 86 #endif // NAZARA_SPRITE_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 module initializer of Graphics.
Definition: Graphics.hpp:15
Core class that represents a string.
Definition: String.hpp:22
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.
Definition: Sprite.hpp:23