Documentation for module: Graphics
Former-commit-id: 5e3ee3c61779fbdd1a083117f537a45e1bad820b
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \brief Constructs a TextSprite object by default
|
||||
*/
|
||||
|
||||
inline TextSprite::TextSprite() :
|
||||
m_color(Color::White),
|
||||
m_scale(1.f)
|
||||
@@ -14,12 +18,24 @@ namespace Nz
|
||||
SetDefaultMaterial();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Constructs a TextSprite object with a drawer
|
||||
*
|
||||
* \param drawer Drawer used to compose text on the sprite
|
||||
*/
|
||||
|
||||
inline TextSprite::TextSprite(const AbstractTextDrawer& drawer) :
|
||||
TextSprite()
|
||||
{
|
||||
Update(drawer);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Constructs a TextSprite object by assignation
|
||||
*
|
||||
* \param sprite TextSprite to copy into this
|
||||
*/
|
||||
|
||||
inline TextSprite::TextSprite(const TextSprite& sprite) :
|
||||
InstancedRenderable(sprite),
|
||||
m_renderInfos(sprite.m_renderInfos),
|
||||
@@ -40,6 +56,10 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Clears the data
|
||||
*/
|
||||
|
||||
inline void TextSprite::Clear()
|
||||
{
|
||||
m_atlases.clear();
|
||||
@@ -48,21 +68,42 @@ namespace Nz
|
||||
m_renderInfos.clear();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the color of the text sprite
|
||||
* \return Current color
|
||||
*/
|
||||
|
||||
inline const Color& TextSprite::GetColor() const
|
||||
{
|
||||
return m_color;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the material of the text sprite
|
||||
* \return Current material
|
||||
*/
|
||||
|
||||
inline const MaterialRef& TextSprite::GetMaterial() const
|
||||
{
|
||||
return m_material;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the current scale of the text sprite
|
||||
* \return Current scale
|
||||
*/
|
||||
|
||||
inline float TextSprite::GetScale() const
|
||||
{
|
||||
return m_scale;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the color of the text sprite
|
||||
*
|
||||
* \param color Color for the text sprite
|
||||
*/
|
||||
|
||||
inline void TextSprite::SetColor(const Color& color)
|
||||
{
|
||||
m_color = color;
|
||||
@@ -70,6 +111,11 @@ namespace Nz
|
||||
InvalidateVertices();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the default material of the text sprite (just default material)
|
||||
*/
|
||||
|
||||
|
||||
inline void TextSprite::SetDefaultMaterial()
|
||||
{
|
||||
MaterialRef material = Material::New();
|
||||
@@ -83,11 +129,23 @@ namespace Nz
|
||||
SetMaterial(material);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the material of the text sprite
|
||||
*
|
||||
* \param material Material for the text sprite
|
||||
*/
|
||||
|
||||
inline void TextSprite::SetMaterial(MaterialRef material)
|
||||
{
|
||||
m_material = std::move(material);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the current scale of the text sprite
|
||||
*
|
||||
* \param scale Scale of the text sprite
|
||||
*/
|
||||
|
||||
inline void TextSprite::SetScale(float scale)
|
||||
{
|
||||
m_scale = scale;
|
||||
@@ -95,10 +153,12 @@ namespace Nz
|
||||
InvalidateVertices();
|
||||
}
|
||||
|
||||
inline void TextSprite::InvalidateVertices()
|
||||
{
|
||||
InvalidateInstanceData(0);
|
||||
}
|
||||
/*!
|
||||
* \brief Sets the current text sprite with the content of the other one
|
||||
* \return A reference to this
|
||||
*
|
||||
* \param text sprite The other TextSprite
|
||||
*/
|
||||
|
||||
inline TextSprite& TextSprite::operator=(const TextSprite& text)
|
||||
{
|
||||
@@ -130,6 +190,22 @@ namespace Nz
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Invalidates the vertices
|
||||
*/
|
||||
|
||||
inline void TextSprite::InvalidateVertices()
|
||||
{
|
||||
InvalidateInstanceData(0);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Creates a new text sprite from the arguments
|
||||
* \return A reference to the newly created text sprite
|
||||
*
|
||||
* \param args Arguments for the text sprite
|
||||
*/
|
||||
|
||||
template<typename... Args>
|
||||
TextSpriteRef TextSprite::New(Args&&... args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user