Merge branch 'master' into master
This commit is contained in:
commit
0842aabe5c
1 changed files with 2557 additions and 769 deletions
|
|
@ -1,18 +1,18 @@
|
|||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [text] example - Draw 3d
|
||||
* raylib [text] example - drawing 3d text
|
||||
*
|
||||
* Example complexity rating: [★★★★] 4/4
|
||||
*
|
||||
* NOTE: Draw a 2D text in 3D space, each letter is drawn in a quad (or 2 quads if backface is set)
|
||||
* where the texture coodinates of each quad map to the texture coordinates of the glyphs
|
||||
* inside the font texture.
|
||||
* inside the font texture
|
||||
*
|
||||
* A more efficient approach, i believe, would be to render the text in a render texture and
|
||||
* map that texture to a plane and render that, or maybe a shader but my method allows more
|
||||
* flexibility...for example to change position of each letter individually to make somethink
|
||||
* like a wavy text effect.
|
||||
*
|
||||
* like a wavy text effect
|
||||
*
|
||||
* Special thanks to:
|
||||
* @Nighten for the DrawTextStyle() code https://github.com/NightenDushi/Raylib_DrawTextStyle
|
||||
* Chris Camacho (codifies - http://bedroomcoders.co.uk/) for the alpha discard shader
|
||||
|
|
@ -71,7 +71,7 @@ static void DrawText3D(Font font, const char *text, Vector3 position, float font
|
|||
// Draw a 2D text in 3D space and wave the parts that start with '~~' and end with '~~'
|
||||
// This is a modified version of the original code by @Nighten found here https://github.com/NightenDushi/Raylib_DrawTextStyle
|
||||
static void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, WaveTextConfig *config, float time, Color tint);
|
||||
// Measure a text in 3D ignoring the `~~` chars.
|
||||
// Measure a text in 3D ignoring the `~~` chars
|
||||
static Vector3 MeasureTextWave3D(Font font, const char *text, float fontSize, float fontSpacing, float lineSpacing);
|
||||
// Generates a nice color with a random hue
|
||||
static Color GenerateRandomColor(float s, float v);
|
||||
|
|
@ -151,7 +151,7 @@ int main(void)
|
|||
screenHeight = GetScreenHeight();
|
||||
}
|
||||
UpdateCamera(&camera, camera_mode);
|
||||
|
||||
|
||||
// Handle font files dropped
|
||||
if (IsFileDropped())
|
||||
{
|
||||
|
|
@ -169,7 +169,7 @@ int main(void)
|
|||
font = LoadFont(droppedFiles.paths[0]);
|
||||
fontSize = (float)font.baseSize;
|
||||
}
|
||||
|
||||
|
||||
UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory
|
||||
}
|
||||
|
||||
|
|
@ -567,7 +567,7 @@ static void DrawText3D(Font font, const char *text, Vector3 position, float font
|
|||
}
|
||||
}
|
||||
|
||||
// Draw a 2D text in 3D space and wave the parts that start with `~~` and end with `~~`.
|
||||
// Draw a 2D text in 3D space and wave the parts that start with `~~` and end with `~~`
|
||||
// This is a modified version of the original code by @Nighten found here https://github.com/NightenDushi/Raylib_DrawTextStyle
|
||||
static void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, WaveTextConfig* config, float time, Color tint)
|
||||
{
|
||||
|
|
@ -630,7 +630,7 @@ static void DrawTextWave3D(Font font, const char *text, Vector3 position, float
|
|||
}
|
||||
}
|
||||
|
||||
// Measure a text in 3D ignoring the `~~` chars.
|
||||
// Measure a text in 3D ignoring the `~~` chars
|
||||
static Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, float fontSpacing, float lineSpacing)
|
||||
{
|
||||
int len = TextLength(text);
|
||||
|
|
|
|||
Loading…
Reference in a new issue