فهرست منبع

Added GetDefaultFont() function

Useful to be used with DrawTextEx() to draw with default font and
extended parameters
Ray 11 سال پیش
والد
کامیت
1a8ef80abd
2فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 1 0
      src/raylib.h
  2. 6 0
      src/text.c

+ 1 - 0
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)

+ 6 - 0
src/text.c

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