summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorMurray Campbell <[email protected]>2018-09-21 18:09:53 -0500
committerGitHub <[email protected]>2018-09-21 18:09:53 -0500
commitc015529088e62b26c8419a1e1ed026ec959d24a7 (patch)
tree96806f05ec37bd5c5e6a93ffcf7120d1c663f982 /examples
parentf97bb085bf71bbaa7aed223e9243029979ba4948 (diff)
parent9efe5c6802b25f0e773b659f87153f309b8af8e2 (diff)
downloadraylib-c015529088e62b26c8419a1e1ed026ec959d24a7.tar.gz
raylib-c015529088e62b26c8419a1e1ed026ec959d24a7.zip
Merge pull request #5 from raysan5/master
merge
Diffstat (limited to 'examples')
-rw-r--r--examples/text/text_font_sdf.c5
-rw-r--r--examples/textures/textures_image_text.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/examples/text/text_font_sdf.c b/examples/text/text_font_sdf.c
index c23a1e2e..755b642d 100644
--- a/examples/text/text_font_sdf.c
+++ b/examples/text/text_font_sdf.c
@@ -29,19 +29,18 @@ int main()
fontDefault.baseSize = 16;
fontDefault.charsCount = 95;
// Parameters > font size: 16, no chars array provided (0), chars count: 95 (autogenerate chars array)
- fontDefault.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, 0, 95, false);
+ fontDefault.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, 0, 95, FONT_DEFAULT);
// Parameters > chars count: 95, font size: 16, chars padding in image: 4 px, pack method: 0 (default)
Image atlas = GenImageFontAtlas(fontDefault.chars, 95, 16, 4, 0);
fontDefault.texture = LoadTextureFromImage(atlas);
UnloadImage(atlas);
// SDF font generation from TTF font
- // NOTE: SDF chars data is generated with LoadFontData(), it's just a bool option
Font fontSDF = { 0 };
fontSDF.baseSize = 16;
fontSDF.charsCount = 95;
// Parameters > font size: 16, no chars array provided (0), chars count: 0 (defaults to 95)
- fontSDF.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, 0, 0, true);
+ fontSDF.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, 0, 0, FONT_SDF);
// Parameters > chars count: 95, font size: 16, chars padding in image: 0 px, pack method: 1 (Skyline algorythm)
atlas = GenImageFontAtlas(fontSDF.chars, 95, 16, 0, 1);
fontSDF.texture = LoadTextureFromImage(atlas);
diff --git a/examples/textures/textures_image_text.c b/examples/textures/textures_image_text.c
index c69f0f55..fb99e827 100644
--- a/examples/textures/textures_image_text.c
+++ b/examples/textures/textures_image_text.c
@@ -26,7 +26,7 @@ int main()
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
// Draw over image using custom font
- ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, WHITE);
+ ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, RED);
Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM)
UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM