diff options
| author | raysan5 <[email protected]> | 2017-07-24 20:04:54 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2017-07-24 20:04:54 +0200 |
| commit | 072684d276373b58ddf7203e34b66a14f6e0c848 (patch) | |
| tree | 64dd10af55f0602864ce79eb9c46a23531341059 /docs/examples/src/text | |
| parent | b2712b6db7c184aff47436f387f2012cf77f4f67 (diff) | |
| download | raylib-072684d276373b58ddf7203e34b66a14f6e0c848.tar.gz raylib-072684d276373b58ddf7203e34b66a14f6e0c848.zip | |
Removed webpage from raylib repo
Moved to own repo at @raysan5/raylib.com
Diffstat (limited to 'docs/examples/src/text')
| -rw-r--r-- | docs/examples/src/text/text_bmfont_ttf.c | 68 | ||||
| -rw-r--r-- | docs/examples/src/text/text_bmfont_unordered.c | 65 | ||||
| -rw-r--r-- | docs/examples/src/text/text_format_text.c | 62 | ||||
| -rw-r--r-- | docs/examples/src/text/text_input_box.c | 116 | ||||
| -rw-r--r-- | docs/examples/src/text/text_raylib_fonts.c | 103 | ||||
| -rw-r--r-- | docs/examples/src/text/text_sprite_fonts.c | 77 | ||||
| -rw-r--r-- | docs/examples/src/text/text_ttf_loading.c | 130 | ||||
| -rw-r--r-- | docs/examples/src/text/text_writing_anim.c | 62 |
8 files changed, 0 insertions, 683 deletions
diff --git a/docs/examples/src/text/text_bmfont_ttf.c b/docs/examples/src/text/text_bmfont_ttf.c deleted file mode 100644 index 0778fd11..00000000 --- a/docs/examples/src/text/text_bmfont_ttf.c +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************************* -* -* raylib [text] example - BMFont and TTF SpriteFonts loading -* -* This example has been created using raylib 1.4 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2016 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -int main() -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [text] example - bmfont and ttf sprite fonts loading"); - - const char msgBm[64] = "THIS IS AN AngelCode SPRITE FONT"; - const char msgTtf[64] = "THIS SPRITE FONT has been GENERATED from a TTF"; - - // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required) - SpriteFont fontBm = LoadSpriteFont("resources/bmfont.fnt"); // BMFont (AngelCode) - SpriteFont fontTtf = LoadSpriteFont("resources/pixantiqua.ttf"); // TTF font - - Vector2 fontPosition; - - fontPosition.x = screenWidth/2 - MeasureTextEx(fontBm, msgBm, fontBm.baseSize, 0).x/2; - fontPosition.y = screenHeight/2 - fontBm.baseSize/2 - 80; - - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - // TODO: Update variables here... - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawTextEx(fontBm, msgBm, fontPosition, fontBm.baseSize, 0, MAROON); - DrawTextEx(fontTtf, msgTtf, (Vector2){ 75.0f, 240.0f }, fontTtf.baseSize*0.8f, 2, LIME); - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - UnloadSpriteFont(fontBm); // AngelCode SpriteFont unloading - UnloadSpriteFont(fontTtf); // TTF SpriteFont unloading - - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -}
\ No newline at end of file diff --git a/docs/examples/src/text/text_bmfont_unordered.c b/docs/examples/src/text/text_bmfont_unordered.c deleted file mode 100644 index 01561bec..00000000 --- a/docs/examples/src/text/text_bmfont_unordered.c +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************************* -* -* raylib [text] example - BMFont unordered chars loading and drawing -* -* This example has been created using raylib 1.4 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2016 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -int main() -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [text] example - bmfont unordered loading and drawing"); - - // NOTE: Using chars outside the [32..127] limits! - // NOTE: If a character is not found in the font, it just renders a space - const char msg[256] = "ASCII extended characters:\n¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆ\nÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæ\nçèéêëìíîïðñòóôõö÷øùúûüýþÿ"; - - // NOTE: Loaded font has an unordered list of characters (chars in the range 32..255) - SpriteFont font = LoadSpriteFont("resources/pixantiqua.fnt"); // BMFont (AngelCode) - - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - // TODO: Update variables here... - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawText("Font name: PixAntiqua", 40, 50, 20, GRAY); - DrawText(FormatText("Font base size: %i", font.baseSize), 40, 80, 20, GRAY); - DrawText(FormatText("Font chars number: %i", font.charsCount), 40, 110, 20, GRAY); - - DrawTextEx(font, msg, (Vector2){ 40, 180 }, font.baseSize, 0, MAROON); - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - UnloadSpriteFont(font); // AngelCode SpriteFont unloading - - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -}
\ No newline at end of file diff --git a/docs/examples/src/text/text_format_text.c b/docs/examples/src/text/text_format_text.c deleted file mode 100644 index ca28be74..00000000 --- a/docs/examples/src/text/text_format_text.c +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************************* -* -* raylib [text] example - Text formatting -* -* This example has been created using raylib 1.1 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2014 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -int main() -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [text] example - text formatting"); - - int score = 100020; - int hiscore = 200450; - int lives = 5; - - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - // TODO: Update your variables here - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawText(FormatText("Score: %08i", score), 200, 80, 20, RED); - - DrawText(FormatText("HiScore: %08i", hiscore), 200, 120, 20, GREEN); - - DrawText(FormatText("Lives: %02i", lives), 200, 160, 40, BLUE); - - DrawText(FormatText("Elapsed Time: %02.02f ms", GetFrameTime()*1000), 200, 220, 20, BLACK); - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -}
\ No newline at end of file diff --git a/docs/examples/src/text/text_input_box.c b/docs/examples/src/text/text_input_box.c deleted file mode 100644 index 54eebf40..00000000 --- a/docs/examples/src/text/text_input_box.c +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************************* -* -* raylib [text] example - Input Box -* -* This example has been created using raylib 1.7 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2017 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -#define MAX_INPUT_CHARS 9 - -int main() -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [text] example - input box"); - - char name[MAX_INPUT_CHARS + 1] = "\0"; // NOTE: One extra space required for line ending char '\0' - int letterCount = 0; - - Rectangle textBox = { screenWidth/2 - 100, 180, 225, 50 }; - bool mouseOnText = false; - - int framesCounter = 0; - - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - if (CheckCollisionPointRec(GetMousePosition(), textBox)) mouseOnText = true; - else mouseOnText = false; - - if (mouseOnText) - { - int key = GetKeyPressed(); - - // NOTE: Only allow keys in range [32..125] - if ((key >= 32) && (key <= 125) && (letterCount < MAX_INPUT_CHARS)) - { - name[letterCount] = (char)key; - letterCount++; - } - - if (key == KEY_BACKSPACE) - { - letterCount--; - name[letterCount] = '\0'; - - if (letterCount < 0) letterCount = 0; - } - } - - if (mouseOnText) framesCounter++; - else framesCounter = 0; - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, GRAY); - - DrawRectangleRec(textBox, LIGHTGRAY); - if (mouseOnText) DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RED); - else DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, DARKGRAY); - - DrawText(name, textBox.x + 5, textBox.y + 8, 40, MAROON); - - DrawText(FormatText("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, DARKGRAY); - - if (mouseOnText) - { - if (letterCount < MAX_INPUT_CHARS) - { - // Draw blinking underscore char - if (((framesCounter/20)%2) == 0) DrawText("_", textBox.x + 8 + MeasureText(name, 40), textBox.y + 12, 40, MAROON); - } - else DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, GRAY); - } - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -} - -// Check if any key is pressed -// NOTE: We limit keys check to keys between 32 (KEY_SPACE) and 126 -bool IsAnyKeyPressed() -{ - bool keyPressed = false; - int key = GetKeyPressed(); - - if ((key >= 32) && (key <= 126)) keyPressed = true; - - return keyPressed; -}
\ No newline at end of file diff --git a/docs/examples/src/text/text_raylib_fonts.c b/docs/examples/src/text/text_raylib_fonts.c deleted file mode 100644 index 6d8ef2b6..00000000 --- a/docs/examples/src/text/text_raylib_fonts.c +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************************* -* -* raylib [text] example - raylib font loading and usage -* -* NOTE: raylib is distributed with some free to use fonts (even for commercial pourposes!) -* To view details and credits for those fonts, check raylib license file -* -* This example has been created using raylib 1.7 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2017 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -#define MAX_FONTS 8 - -int main() -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [text] example - raylib fonts"); - - // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) - SpriteFont fonts[MAX_FONTS]; - - fonts[0] = LoadSpriteFont("resources/fonts/alagard.png"); - fonts[1] = LoadSpriteFont("resources/fonts/pixelplay.png"); - fonts[2] = LoadSpriteFont("resources/fonts/mecha.png"); - fonts[3] = LoadSpriteFont("resources/fonts/setback.png"); - fonts[4] = LoadSpriteFont("resources/fonts/romulus.png"); - fonts[5] = LoadSpriteFont("resources/fonts/pixantiqua.png"); - fonts[6] = LoadSpriteFont("resources/fonts/alpha_beta.png"); - fonts[7] = LoadSpriteFont("resources/fonts/jupiter_crash.png"); - - const char *messages[MAX_FONTS] = { "ALAGARD FONT designed by Hewett Tsoi", - "PIXELPLAY FONT designed by Aleksander Shevchuk", - "MECHA FONT designed by Captain Falcon", - "SETBACK FONT designed by Brian Kent (AEnigma)", - "ROMULUS FONT designed by Hewett Tsoi", - "PIXANTIQUA FONT designed by Gerhard Grossmann", - "ALPHA_BETA FONT designed by Brian Kent (AEnigma)", - "JUPITER_CRASH FONT designed by Brian Kent (AEnigma)" }; - - const int spacings[MAX_FONTS] = { 2, 4, 8, 4, 3, 4, 4, 1 }; - - Vector2 positions[MAX_FONTS]; - - for (int i = 0; i < MAX_FONTS; i++) - { - positions[i].x = screenWidth/2 - MeasureTextEx(fonts[i], messages[i], fonts[i].baseSize*2, spacings[i]).x/2; - positions[i].y = 60 + fonts[i].baseSize + 45*i; - } - - // Small Y position corrections - positions[3].y += 8; - positions[4].y += 2; - positions[7].y -= 8; - - Color colors[MAX_FONTS] = { MAROON, ORANGE, DARKGREEN, DARKBLUE, DARKPURPLE, LIME, GOLD, RED }; - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - // TODO: Update your variables here - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawText("free fonts included with raylib", 250, 20, 20, DARKGRAY); - DrawLine(220, 50, 590, 50, DARKGRAY); - - for (int i = 0; i < MAX_FONTS; i++) - { - DrawTextEx(fonts[i], messages[i], positions[i], fonts[i].baseSize*2, spacings[i], colors[i]); - } - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - - // SpriteFonts unloading - for (int i = 0; i < MAX_FONTS; i++) UnloadSpriteFont(fonts[i]); - - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -}
\ No newline at end of file diff --git a/docs/examples/src/text/text_sprite_fonts.c b/docs/examples/src/text/text_sprite_fonts.c deleted file mode 100644 index aefbfd1f..00000000 --- a/docs/examples/src/text/text_sprite_fonts.c +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************************* -* -* raylib [text] example - SpriteFont loading and usage -* -* This example has been created using raylib 1.0 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2014 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -int main() -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [text] example - sprite fonts usage"); - - const char msg1[50] = "THIS IS A custom SPRITE FONT..."; - const char msg2[50] = "...and this is ANOTHER CUSTOM font..."; - const char msg3[50] = "...and a THIRD one! GREAT! :D"; - - // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required) - SpriteFont font1 = LoadSpriteFont("resources/custom_mecha.png"); // SpriteFont loading - SpriteFont font2 = LoadSpriteFont("resources/custom_alagard.png"); // SpriteFont loading - SpriteFont font3 = LoadSpriteFont("resources/custom_jupiter_crash.png"); // SpriteFont loading - - Vector2 fontPosition1, fontPosition2, fontPosition3; - - fontPosition1.x = screenWidth/2 - MeasureTextEx(font1, msg1, font1.baseSize, -3).x/2; - fontPosition1.y = screenHeight/2 - font1.baseSize/2 - 80; - - fontPosition2.x = screenWidth/2 - MeasureTextEx(font2, msg2, font2.baseSize, -2).x/2; - fontPosition2.y = screenHeight/2 - font2.baseSize/2 - 10; - - fontPosition3.x = screenWidth/2 - MeasureTextEx(font3, msg3, font3.baseSize, 2).x/2; - fontPosition3.y = screenHeight/2 - font3.baseSize/2 + 50; - - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - // TODO: Update variables here... - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawTextEx(font1, msg1, fontPosition1, font1.baseSize, -3, WHITE); - DrawTextEx(font2, msg2, fontPosition2, font2.baseSize, -2, WHITE); - DrawTextEx(font3, msg3, fontPosition3, font3.baseSize, 2, WHITE); - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - UnloadSpriteFont(font1); // SpriteFont unloading - UnloadSpriteFont(font2); // SpriteFont unloading - UnloadSpriteFont(font3); // SpriteFont unloading - - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -}
\ No newline at end of file diff --git a/docs/examples/src/text/text_ttf_loading.c b/docs/examples/src/text/text_ttf_loading.c deleted file mode 100644 index 02b7f95f..00000000 --- a/docs/examples/src/text/text_ttf_loading.c +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************************* -* -* raylib [text] example - TTF loading and usage -* -* This example has been created using raylib 1.3.0 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2015 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -int main() -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [text] example - ttf loading"); - - const char msg[50] = "TTF SpriteFont"; - - // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required) - - // TTF SpriteFont loading with custom generation parameters - SpriteFont font = LoadSpriteFontEx("resources/KAISG.ttf", 96, 0, 0); - - // Generate mipmap levels to use trilinear filtering - // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR - GenTextureMipmaps(&font.texture); - - float fontSize = font.baseSize; - Vector2 fontPosition = { 40, screenHeight/2 + 50 }; - Vector2 textSize; - - SetTextureFilter(font.texture, FILTER_POINT); - int currentFontFilter = 0; // FILTER_POINT - - int count = 0; - char **droppedFiles; - - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - fontSize += GetMouseWheelMove()*4.0f; - - // Choose font texture filter method - if (IsKeyPressed(KEY_ONE)) - { - SetTextureFilter(font.texture, FILTER_POINT); - currentFontFilter = 0; - } - else if (IsKeyPressed(KEY_TWO)) - { - SetTextureFilter(font.texture, FILTER_BILINEAR); - currentFontFilter = 1; - } - else if (IsKeyPressed(KEY_THREE)) - { - // NOTE: Trilinear filter won't be noticed on 2D drawing - SetTextureFilter(font.texture, FILTER_TRILINEAR); - currentFontFilter = 2; - } - - textSize = MeasureTextEx(font, msg, fontSize, 0); - - if (IsKeyDown(KEY_LEFT)) fontPosition.x -= 10; - else if (IsKeyDown(KEY_RIGHT)) fontPosition.x += 10; - - // Load a dropped TTF file dynamically (at current fontSize) - if (IsFileDropped()) - { - droppedFiles = GetDroppedFiles(&count); - - if (count == 1) // Only support one ttf file dropped - { - UnloadSpriteFont(font); - font = LoadSpriteFontEx(droppedFiles[0], fontSize, 0, 0); - ClearDroppedFiles(); - } - } - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawText("Use mouse wheel to change font size", 20, 20, 10, GRAY); - DrawText("Use KEY_RIGHT and KEY_LEFT to move text", 20, 40, 10, GRAY); - DrawText("Use 1, 2, 3 to change texture filter", 20, 60, 10, GRAY); - DrawText("Drop a new TTF font for dynamic loading", 20, 80, 10, DARKGRAY); - - DrawTextEx(font, msg, fontPosition, fontSize, 0, BLACK); - - // TODO: It seems texSize measurement is not accurate due to chars offsets... - //DrawRectangleLines(fontPosition.x, fontPosition.y, textSize.x, textSize.y, RED); - - DrawRectangle(0, screenHeight - 80, screenWidth, 80, LIGHTGRAY); - DrawText(FormatText("Font size: %02.02f", fontSize), 20, screenHeight - 50, 10, DARKGRAY); - DrawText(FormatText("Text size: [%02.02f, %02.02f]", textSize.x, textSize.y), 20, screenHeight - 30, 10, DARKGRAY); - DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, GRAY); - - if (currentFontFilter == 0) DrawText("POINT", 570, 400, 20, BLACK); - else if (currentFontFilter == 1) DrawText("BILINEAR", 570, 400, 20, BLACK); - else if (currentFontFilter == 2) DrawText("TRILINEAR", 570, 400, 20, BLACK); - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - UnloadSpriteFont(font); // SpriteFont unloading - - ClearDroppedFiles(); // Clear internal buffers - - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -}
\ No newline at end of file diff --git a/docs/examples/src/text/text_writing_anim.c b/docs/examples/src/text/text_writing_anim.c deleted file mode 100644 index 5563b561..00000000 --- a/docs/examples/src/text/text_writing_anim.c +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************************* -* -* raylib [text] example - Text Writing Animation -* -* This example has been created using raylib 1.4 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2016 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -int main() -{ - // Initialization - //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [text] example - text writing anim"); - - const char message[128] = "This sample illustrates a text writing\nanimation effect! Check it out! ;)"; - - int framesCounter = 0; - - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - if (IsKeyDown(KEY_SPACE)) framesCounter += 8; - else framesCounter++; - - if (IsKeyPressed(KEY_ENTER)) framesCounter = 0; - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - DrawText(SubText(message, 0, framesCounter/10), 210, 160, 20, MAROON); - - DrawText("PRESS [ENTER] to RESTART!", 240, 260, 20, LIGHTGRAY); - DrawText("PRESS [SPACE] to SPEED UP!", 239, 300, 20, LIGHTGRAY); - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -}
\ No newline at end of file |
