1212#include " Core/VertexArray.hpp"
1313
1414#include " Util/Color.hpp"
15- #include " Util/Transform.hpp"
1615
1716namespace Util {
1817/* *
@@ -25,8 +24,18 @@ namespace Util {
2524 */
2625class Text : public Core ::Drawable {
2726public:
27+ /* *
28+ * @brief Constructor for the Text class.
29+ *
30+ * @param font The font file path or name.
31+ * @param size The font size.
32+ * @param text The text content to render.
33+ * @param color The color of the text (default is gray).
34+ * @param useAA Flag indicating whether anti-aliasing should be enabled
35+ * (default is true).
36+ */
2837 Text (const std::string &font, int size, const std::string &text,
29- const Util::Color &color = Color(127 , 127 , 127 ));
38+ const Util::Color &color = Color(127 , 127 , 127 ), bool useAA = true );
3039
3140 glm::vec2 GetSize () const override { return m_Size; };
3241
@@ -50,9 +59,26 @@ class Text : public Core::Drawable {
5059 ApplyTexture ();
5160 };
5261
62+ /* *
63+ * @brief Sets whether anti-aliasing (AA) should be enabled or disabled.
64+ *
65+ * @param useAA A boolean value indicating whether anti-aliasing should be
66+ * enabled (true) or disabled (false).
67+ *
68+ * @note This function only sets the internal flag for anti-aliasing and
69+ * does not directly affect rendering. The actual effect of anti-aliasing
70+ * depends on the rendering pipeline and the graphics hardware capabilities.
71+ *
72+ * @sa https://en.wikipedia.org/wiki/Spatial_anti-aliasing
73+ */
74+ void UseAntiAliasing (bool useAA);
75+
5376 /* *
5477 * @brief Draws the text with a given transform and z-index.
5578 *
79+ * This function draws the image at the specified z-index and applies the
80+ * given transform.
81+ *
5682 * @param transform The transform to apply to the text.
5783 * @param zIndex The z-index at which to draw the text.
5884 */
0 commit comments