mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-18 01:08:17 +00:00
ADDED: DrawTextPro() with text rotation support
This commit is contained in:
@@ -1329,6 +1329,7 @@ RLAPI void UnloadFont(Font font);
|
|||||||
RLAPI void DrawFPS(int posX, int posY); // Draw current FPS
|
RLAPI void DrawFPS(int posX, int posY); // Draw current FPS
|
||||||
RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
||||||
RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
|
RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
|
||||||
|
RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation)
|
||||||
RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
|
RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
|
||||||
|
|
||||||
// Text misc. functions
|
// Text misc. functions
|
||||||
|
10
src/text.c
10
src/text.c
@@ -890,7 +890,17 @@ void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draw text using Font and pro parameters (rotation)
|
||||||
|
void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint)
|
||||||
{
|
{
|
||||||
|
rlPushMatrix();
|
||||||
|
|
||||||
|
rlTranslatef(origin.x, origin.y, 0.0f);
|
||||||
|
rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
DrawTextEx(font, text, position, fontSize, spacing, tint);
|
||||||
|
|
||||||
|
rlPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw one character (codepoint)
|
// Draw one character (codepoint)
|
||||||
|
Reference in New Issue
Block a user