Documentation for module: Graphics

Former-commit-id: 1757c33318443aade1dc38e16d053240d7dc885c
This commit is contained in:
Gawaboumga
2016-05-30 14:21:36 +02:00
parent 7721fd2284
commit 2c941827ed
94 changed files with 4858 additions and 504 deletions

View File

@@ -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)
{