From 1df7a8b4a6833d0589470f42db97cc7a423dca0b Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 20 Apr 2017 18:09:30 +0200 Subject: Update some files --- docs/examples/web/textures/resources/scarfy.png | Bin 21597 -> 33146 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'docs/examples') diff --git a/docs/examples/web/textures/resources/scarfy.png b/docs/examples/web/textures/resources/scarfy.png index a377a712..beb5ffa0 100644 Binary files a/docs/examples/web/textures/resources/scarfy.png and b/docs/examples/web/textures/resources/scarfy.png differ -- cgit v1.2.3 From b0f8ea27e3d7417c0f0c9795aa315dac399c97bf Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 22 Apr 2017 19:04:54 +0200 Subject: Renamed function for lib consistency LoadSpriteFontTTF() --> LoadSpriteFontEx() --- docs/examples/src/text/text_ttf_loading.c | 4 ++-- docs/examples/web/text/text_ttf_loading.c | 4 ++-- docs/examples/web/textures/textures_raw_data.c | 2 +- examples/text/text_ttf_loading.c | 4 ++-- src/raylib.h | 2 +- src/text.c | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'docs/examples') diff --git a/docs/examples/src/text/text_ttf_loading.c b/docs/examples/src/text/text_ttf_loading.c index 4e490399..02b7f95f 100644 --- a/docs/examples/src/text/text_ttf_loading.c +++ b/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) // 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 // 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 { UnloadSpriteFont(font); - font = LoadSpriteFontTTF(droppedFiles[0], fontSize, 0, 0); + font = LoadSpriteFontEx(droppedFiles[0], fontSize, 0, 0); ClearDroppedFiles(); } } diff --git a/docs/examples/web/text/text_ttf_loading.c b/docs/examples/web/text/text_ttf_loading.c index 9dfdcac2..02097437 100644 --- a/docs/examples/web/text/text_ttf_loading.c +++ b/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) // 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 // 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 { UnloadSpriteFont(font); - font = LoadSpriteFontTTF(droppedFiles[0], fontSize, 0, 0); + font = LoadSpriteFontEx(droppedFiles[0], fontSize, 0, 0); ClearDroppedFiles(); } } diff --git a/docs/examples/web/textures/textures_raw_data.c b/docs/examples/web/textures/textures_raw_data.c index 245af2e3..f06c798b 100644 --- a/docs/examples/web/textures/textures_raw_data.c +++ b/docs/examples/web/textures/textures_raw_data.c @@ -111,7 +111,7 @@ void UpdateDrawFrame(void) 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); DrawText("CHECKED TEXTURE ", 84, 100, 30, BROWN); diff --git a/examples/text/text_ttf_loading.c b/examples/text/text_ttf_loading.c index 4e490399..02b7f95f 100644 --- a/examples/text/text_ttf_loading.c +++ b/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) // 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 // 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 { UnloadSpriteFont(font); - font = LoadSpriteFontTTF(droppedFiles[0], fontSize, 0, 0); + font = LoadSpriteFontEx(droppedFiles[0], fontSize, 0, 0); ClearDroppedFiles(); } } diff --git a/src/raylib.h b/src/raylib.h index 286494c7..41e1ccb7 100644 --- a/src/raylib.h +++ b/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 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 DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) diff --git a/src/text.c b/src/text.c index ebc8b0ff..cba9a7d6 100644 --- a/src/text.c +++ b/src/text.c @@ -316,7 +316,7 @@ SpriteFont LoadSpriteFont(const char *fileName) //UnloadResource(rres[0]); } #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 #if defined(SUPPORT_FILEFORMAT_FNT) 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 // 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 -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 }; -- cgit v1.2.3 From 332f3b4f9d58eabf54f44a348de24d73d728f560 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 23 Apr 2017 19:24:39 +0200 Subject: Set canvas background to black... ..to avoid blending issues with white background --- docs/examples/web/audio/loader.html | 2 +- docs/examples/web/core/loader.html | 2 +- docs/examples/web/models/loader.html | 2 +- docs/examples/web/physac/loader.html | 2 +- docs/examples/web/shaders/loader.html | 2 +- docs/examples/web/shapes/loader.html | 2 +- docs/examples/web/text/loader.html | 2 +- docs/examples/web/textures/loader.html | 2 +- templates/web_shell/shell.html | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) (limited to 'docs/examples') diff --git a/docs/examples/web/audio/loader.html b/docs/examples/web/audio/loader.html index c5e18be0..93d7260f 100644 --- a/docs/examples/web/audio/loader.html +++ b/docs/examples/web/audio/loader.html @@ -36,7 +36,7 @@ } #eximage { width: 802px; height: 452px; text-align: center; } #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; background: black; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; diff --git a/docs/examples/web/core/loader.html b/docs/examples/web/core/loader.html index c5e18be0..93d7260f 100644 --- a/docs/examples/web/core/loader.html +++ b/docs/examples/web/core/loader.html @@ -36,7 +36,7 @@ } #eximage { width: 802px; height: 452px; text-align: center; } #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; background: black; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; diff --git a/docs/examples/web/models/loader.html b/docs/examples/web/models/loader.html index c5e18be0..93d7260f 100644 --- a/docs/examples/web/models/loader.html +++ b/docs/examples/web/models/loader.html @@ -36,7 +36,7 @@ } #eximage { width: 802px; height: 452px; text-align: center; } #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; background: black; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; diff --git a/docs/examples/web/physac/loader.html b/docs/examples/web/physac/loader.html index c5e18be0..93d7260f 100644 --- a/docs/examples/web/physac/loader.html +++ b/docs/examples/web/physac/loader.html @@ -36,7 +36,7 @@ } #eximage { width: 802px; height: 452px; text-align: center; } #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; background: black; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; diff --git a/docs/examples/web/shaders/loader.html b/docs/examples/web/shaders/loader.html index c5e18be0..93d7260f 100644 --- a/docs/examples/web/shaders/loader.html +++ b/docs/examples/web/shaders/loader.html @@ -36,7 +36,7 @@ } #eximage { width: 802px; height: 452px; text-align: center; } #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; background: black; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; diff --git a/docs/examples/web/shapes/loader.html b/docs/examples/web/shapes/loader.html index c5e18be0..93d7260f 100644 --- a/docs/examples/web/shapes/loader.html +++ b/docs/examples/web/shapes/loader.html @@ -36,7 +36,7 @@ } #eximage { width: 802px; height: 452px; text-align: center; } #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; background: black; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; diff --git a/docs/examples/web/text/loader.html b/docs/examples/web/text/loader.html index c5e18be0..93d7260f 100644 --- a/docs/examples/web/text/loader.html +++ b/docs/examples/web/text/loader.html @@ -36,7 +36,7 @@ } #eximage { width: 802px; height: 452px; text-align: center; } #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; background: black; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; diff --git a/docs/examples/web/textures/loader.html b/docs/examples/web/textures/loader.html index c5e18be0..93d7260f 100644 --- a/docs/examples/web/textures/loader.html +++ b/docs/examples/web/textures/loader.html @@ -36,7 +36,7 @@ } #eximage { width: 802px; height: 452px; text-align: center; } #eximage img { margin: 0 auto; border: 1px solid; border-color: black; } - #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; } + #eximage canvas { position: relative; top: 1px; left: 1px; border: 1px solid red; background: black; } pre { width: 802px!important;} pre code{ border: 1px solid; border-color:#b0b0b0; height:auto; } .exdownbtn{ margin-right: 20px; width:220px; height:30px; float:left; position: relative; cursor:pointer; font-weight:bold; font-size:10px; diff --git a/templates/web_shell/shell.html b/templates/web_shell/shell.html index d602b5b5..d9a3c49e 100644 --- a/templates/web_shell/shell.html +++ b/templates/web_shell/shell.html @@ -57,7 +57,7 @@ div.emscripten_border { border: 1px solid black; } /* the canvas *must not* have any border or padding, or mouse coords will be wrong */ - canvas.emscripten { border: 0px none; } + canvas.emscripten { border: 0px none; background: black; } #emscripten_logo { display: inline-block; -- cgit v1.2.3