drawUIText ========== :doc:`/types/Script/index`::drawUIText Draws text on the User Interface. Declaration ----------- .. code-block:: cpp void drawUIText(FontID fontID, const std::wstring& text, AnchorPoint anchorPoint, CoordinateType coordinateType, const Math::vec2& position, float rotation = 0.0f, const Math::vec2& scale = Math::vec2(1.0f, 1.0f), const Math::vec4& color = Math::vec4(0.0f, 0.0f, 0.0f, 1.0f)); Parameters ---------- .. list-table:: :width: 100% :header-rows: 1 :class: code-table * - Name - Type - Description * - fontID - :doc:`/types/FontID/index` - The font to use to draw the text. * - text - const `std::wstring `_\& - The text to draw. * - anchorPoint - :doc:`/types/AnchorPoint/index` - The anchor point of the text. * - coordinateType - :doc:`/types/CoordinateType/index` - The coordinate type used by ``position``. * - position - const :doc:`/types/Math/index`::vec2& - The position where the text will be drawn. * - rotation - float - The rotation of the text. * - scale - const :doc:`/types/Math/index`::vec2& - The scale of the text. * - color - const :doc:`/types/Math/index`::vec4& - The color and opacity of the text. Returns ------- None. Notes ----- If ``text`` is directly written on the source code, the string literal "*L*" must be used, for example: *L"NutshellEngine"*. If a ``scale``'s axis (*x* or *y*) is negative, the text will be flipped. For example, if ``scale`` is equal to ``Math::vec2(-1.0f, 1.0f)``, the text will have its original proportion but will be flipped horizontally. ==== Draws text on the User Interface. Declaration ----------- .. code-block:: cpp void drawUIText(FontID fontID, const std::string& text, AnchorPoint anchorPoint, CoordinateType coordinateType, const Math::vec2& position, float rotation = 0.0f, const Math::vec2& scale = Math::vec2(1.0f, 1.0f), const Math::vec4& color = Math::vec4(0.0f, 0.0f, 0.0f, 1.0f)); Parameters ---------- .. list-table:: :width: 100% :header-rows: 1 :class: code-table * - Name - Type - Description * - fontID - :doc:`/types/FontID/index` - The font to use to draw the text. * - text - const `std::string `_\& - The text to draw. * - anchorPoint - :doc:`/types/AnchorPoint/index` - The anchor point of the text. * - coordinateType - :doc:`/types/CoordinateType/index` - The coordinate type used by ``position``. * - position - const :doc:`/types/Math/index`::vec2& - The position where the text will be drawn. * - rotation - float - The rotation of the text. * - scale - const :doc:`/types/Math/index`::vec2& - The scale of the text. * - color - const :doc:`/types/Math/index`::vec4& - The color and opacity of the text. Returns ------- None. Notes ----- If a ``scale``'s axis (*x* or *y*) is negative, the text will be flipped. For example, if ``scale`` is equal to ``Math::vec2(-1.0f, 1.0f)``, the text will have its original proportion but will be flipped horizontally.