rename Font into RLFont
prevent conflict with Xlib.h
This commit is contained in:
parent
521ceeb174
commit
19cd976000
1 changed files with 327 additions and 329 deletions
|
|
@ -60,17 +60,17 @@ typedef struct WaveTextConfig {
|
|||
// Module Functions Declaration
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Draw a codepoint in 3D space
|
||||
static void DrawTextCodepoint3D(Font font, int codepoint, Vector3 position, float fontSize, bool backface, Color tint);
|
||||
static void DrawTextCodepoint3D(RLFont font, int codepoint, Vector3 position, float fontSize, bool backface, Color tint);
|
||||
// Draw a 2D text in 3D space
|
||||
static void DrawText3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, Color tint);
|
||||
static void DrawText3D(RLFont font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, Color tint);
|
||||
// Measure a text in 3D. For some reason `MeasureTextEx()` just doesn't seem to work so i had to use this instead.
|
||||
static Vector3 MeasureText3D(Font font, const char *text, float fontSize, float fontSpacing, float lineSpacing);
|
||||
static Vector3 MeasureText3D(RLFont font, const char *text, float fontSize, float fontSpacing, float lineSpacing);
|
||||
|
||||
// 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);
|
||||
static void DrawTextWave3D(RLFont 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.
|
||||
static Vector3 MeasureTextWave3D(Font font, const char *text, float fontSize, float fontSpacing, float lineSpacing);
|
||||
static Vector3 MeasureTextWave3D(RLFont 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);
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ int main(void)
|
|||
Vector3 cubeSize = { 2.0f, 2.0f, 2.0f };
|
||||
|
||||
// Use the default font
|
||||
Font font = GetFontDefault();
|
||||
RLFont font = GetFontDefault();
|
||||
float fontSize = 8.0f;
|
||||
float fontSpacing = 0.5f;
|
||||
float lineSpacing = -1.0f;
|
||||
|
|
@ -451,7 +451,7 @@ int main(void)
|
|||
// Module Functions Definitions
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Draw codepoint at specified position in 3D space
|
||||
static void DrawTextCodepoint3D(Font font, int codepoint, Vector3 position, float fontSize, bool backface, Color tint)
|
||||
static void DrawTextCodepoint3D(RLFont font, int codepoint, Vector3 position, float fontSize, bool backface, Color tint)
|
||||
{
|
||||
// Character index position in sprite font
|
||||
// NOTE: In case a codepoint is not available in the font, index returned points to '?'
|
||||
|
|
@ -518,7 +518,7 @@ static void DrawTextCodepoint3D(Font font, int codepoint, Vector3 position, floa
|
|||
}
|
||||
|
||||
// Draw a 2D text in 3D space
|
||||
static void DrawText3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, Color tint)
|
||||
static void DrawText3D(RLFont font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, Color tint)
|
||||
{
|
||||
int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop
|
||||
|
||||
|
|
@ -561,7 +561,7 @@ static void DrawText3D(Font font, const char *text, Vector3 position, float font
|
|||
}
|
||||
|
||||
// Measure a text in 3D. For some reason `MeasureTextEx()` just doesn't seem to work so i had to use this instead.
|
||||
static Vector3 MeasureText3D(Font font, const char* text, float fontSize, float fontSpacing, float lineSpacing)
|
||||
static Vector3 MeasureText3D(RLFont font, const char* text, float fontSize, float fontSpacing, float lineSpacing)
|
||||
{
|
||||
int len = TextLength(text);
|
||||
int tempLen = 0; // Used to count longer text line num chars
|
||||
|
|
@ -617,7 +617,7 @@ static Vector3 MeasureText3D(Font font, const char* text, float fontSize, float
|
|||
|
||||
// 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)
|
||||
static void DrawTextWave3D(RLFont font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, WaveTextConfig* config, float time, Color tint)
|
||||
{
|
||||
int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop
|
||||
|
||||
|
|
@ -679,7 +679,7 @@ static void DrawTextWave3D(Font font, const char *text, Vector3 position, float
|
|||
}
|
||||
|
||||
// Measure a text in 3D ignoring the `~~` chars.
|
||||
static Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, float fontSpacing, float lineSpacing)
|
||||
static Vector3 MeasureTextWave3D(RLFont font, const char* text, float fontSize, float fontSpacing, float lineSpacing)
|
||||
{
|
||||
int len = TextLength(text);
|
||||
int tempLen = 0; // Used to count longer text line num chars
|
||||
|
|
|
|||
Loading…
Reference in a new issue