Browse Source

Renamed function for lib consistency

LoadSpriteFontTTF() --> LoadSpriteFontEx()
raysan5 8 years ago
parent
commit
b0f8ea27e3

+ 2 - 2
docs/examples/src/text/text_ttf_loading.c

@@ -25,7 +25,7 @@ int main()
     // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
     // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
     
     
     // TTF SpriteFont loading with custom generation parameters
     // TTF SpriteFont loading with custom generation parameters
-    SpriteFont font = LoadSpriteFontTTF("resources/KAISG.ttf", 96, 0, 0);
+    SpriteFont font = LoadSpriteFontEx("resources/KAISG.ttf", 96, 0, 0);
     
     
     // Generate mipmap levels to use trilinear filtering
     // Generate mipmap levels to use trilinear filtering
     // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
     // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
@@ -82,7 +82,7 @@ int main()
             if (count == 1) // Only support one ttf file dropped
             if (count == 1) // Only support one ttf file dropped
             {
             {
                 UnloadSpriteFont(font);
                 UnloadSpriteFont(font);
-                font = LoadSpriteFontTTF(droppedFiles[0], fontSize, 0, 0);
+                font = LoadSpriteFontEx(droppedFiles[0], fontSize, 0, 0);
                 ClearDroppedFiles();
                 ClearDroppedFiles();
             }
             }
         }
         }

+ 2 - 2
docs/examples/web/text/text_ttf_loading.c

@@ -52,7 +52,7 @@ int main()
     // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
     // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
     
     
     // TTF SpriteFont loading with custom generation parameters
     // TTF SpriteFont loading with custom generation parameters
-    font = LoadSpriteFontTTF("resources/KAISG.ttf", 96, 0, 0);
+    font = LoadSpriteFontEx("resources/KAISG.ttf", 96, 0, 0);
     
     
     // Generate mipmap levels to use trilinear filtering
     // Generate mipmap levels to use trilinear filtering
     // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
     // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
@@ -130,7 +130,7 @@ void UpdateDrawFrame(void)
         if (count == 1) // Only support one ttf file dropped
         if (count == 1) // Only support one ttf file dropped
         {
         {
             UnloadSpriteFont(font);
             UnloadSpriteFont(font);
-            font = LoadSpriteFontTTF(droppedFiles[0], fontSize, 0, 0);
+            font = LoadSpriteFontEx(droppedFiles[0], fontSize, 0, 0);
             ClearDroppedFiles();
             ClearDroppedFiles();
         }
         }
     }
     }

+ 1 - 1
docs/examples/web/textures/textures_raw_data.c

@@ -111,7 +111,7 @@ void UpdateDrawFrame(void)
 
 
         ClearBackground(RAYWHITE);
         ClearBackground(RAYWHITE);
 
 
-        DrawTexture(checked, screenWidth/2 - checked.width/2, screenHeight/2 - checked.height/2, WHITE);
+        DrawTexture(checked, screenWidth/2 - checked.width/2, screenHeight/2 - checked.height/2, Fade(WHITE, 0.5f));
         DrawTexture(fudesumi, 430, -30, WHITE);
         DrawTexture(fudesumi, 430, -30, WHITE);
 
 
         DrawText("CHECKED TEXTURE ", 84, 100, 30, BROWN);
         DrawText("CHECKED TEXTURE ", 84, 100, 30, BROWN);

+ 2 - 2
examples/text/text_ttf_loading.c

@@ -25,7 +25,7 @@ int main()
     // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
     // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
     
     
     // TTF SpriteFont loading with custom generation parameters
     // TTF SpriteFont loading with custom generation parameters
-    SpriteFont font = LoadSpriteFontTTF("resources/KAISG.ttf", 96, 0, 0);
+    SpriteFont font = LoadSpriteFontEx("resources/KAISG.ttf", 96, 0, 0);
     
     
     // Generate mipmap levels to use trilinear filtering
     // Generate mipmap levels to use trilinear filtering
     // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
     // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
@@ -82,7 +82,7 @@ int main()
             if (count == 1) // Only support one ttf file dropped
             if (count == 1) // Only support one ttf file dropped
             {
             {
                 UnloadSpriteFont(font);
                 UnloadSpriteFont(font);
-                font = LoadSpriteFontTTF(droppedFiles[0], fontSize, 0, 0);
+                font = LoadSpriteFontEx(droppedFiles[0], fontSize, 0, 0);
                 ClearDroppedFiles();
                 ClearDroppedFiles();
             }
             }
         }
         }

+ 1 - 1
src/raylib.h

@@ -867,7 +867,7 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest
 //------------------------------------------------------------------------------------
 //------------------------------------------------------------------------------------
 RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont
 RLAPI SpriteFont GetDefaultFont(void);                                                                   // Get the default SpriteFont
 RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM)
 RLAPI SpriteFont LoadSpriteFont(const char *fileName);                                                   // Load SpriteFont from file into GPU memory (VRAM)
-RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int charsCount, int *fontChars);  // Load SpriteFont from TTF font file with generation parameters
+RLAPI SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars);   // Load SpriteFont from file with extended parameters
 RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM)
 RLAPI void UnloadSpriteFont(SpriteFont spriteFont);                                                      // Unload SpriteFont from GPU memory (VRAM)
 
 
 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)

+ 2 - 2
src/text.c

@@ -316,7 +316,7 @@ SpriteFont LoadSpriteFont(const char *fileName)
         //UnloadResource(rres[0]);
         //UnloadResource(rres[0]);
     }
     }
 #if defined(SUPPORT_FILEFORMAT_TTF)
 #if defined(SUPPORT_FILEFORMAT_TTF)
-    else if (IsFileExtension(fileName, ".ttf")) spriteFont = LoadSpriteFontTTF(fileName, DEFAULT_TTF_FONTSIZE, 0, NULL);
+    else if (IsFileExtension(fileName, ".ttf")) spriteFont = LoadSpriteFontEx(fileName, DEFAULT_TTF_FONTSIZE, 0, NULL);
 #endif
 #endif
 #if defined(SUPPORT_FILEFORMAT_FNT)
 #if defined(SUPPORT_FILEFORMAT_FNT)
     else if (IsFileExtension(fileName, ".fnt")) spriteFont = LoadBMFont(fileName);
     else if (IsFileExtension(fileName, ".fnt")) spriteFont = LoadBMFont(fileName);
@@ -341,7 +341,7 @@ SpriteFont LoadSpriteFont(const char *fileName)
 // Load SpriteFont from TTF font file with generation parameters
 // Load SpriteFont from TTF font file with generation parameters
 // NOTE: You can pass an array with desired characters, those characters should be available in the font
 // NOTE: You can pass an array with desired characters, those characters should be available in the font
 // if array is NULL, default char set is selected 32..126
 // if array is NULL, default char set is selected 32..126
-SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int charsCount, int *fontChars)
+SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars)
 {
 {
     SpriteFont spriteFont = { 0 };
     SpriteFont spriteFont = { 0 };