diff options
| author | Ray <raysan5@gmail.com> | 2013-11-29 20:24:11 +0100 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2013-11-29 20:24:11 +0100 |
| commit | 1a8ef80abd4e3824bb441e0dbd58848ab451c0e1 (patch) | |
| tree | fd688db9c10c62cbdcb7382ee608070341d2536e /src | |
| parent | 53d0ab0b97ed77ea0277af9bd661cf2573ddb377 (diff) | |
| download | raylib-1a8ef80abd4e3824bb441e0dbd58848ab451c0e1.tar.gz raylib-1a8ef80abd4e3824bb441e0dbd58848ab451c0e1.zip | |
Added GetDefaultFont() function
Useful to be used with DrawTextEx() to draw with default font and
extended parameters
Diffstat (limited to 'src')
| -rw-r--r-- | src/raylib.h | 1 | ||||
| -rw-r--r-- | src/text.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/raylib.h b/src/raylib.h index 14a3300e..54065dd0 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -317,6 +317,7 @@ void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, V //------------------------------------------------------------------------------------ // Font Loading and Text Drawing Functions (Module: text) //------------------------------------------------------------------------------------ +SpriteFont GetDefaultFont(); // Get the default SpriteFont SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) @@ -192,6 +192,12 @@ extern void UnloadDefaultFont() free(defaultFont.charSet); } +// Get the default font, useful to be used with extended parameters +SpriteFont GetDefaultFont() +{ + return defaultFont; +} + // Load a SpriteFont image into GPU memory SpriteFont LoadSpriteFont(const char* fileName) { |
