diff options
| -rw-r--r-- | cheatsheet/raylib_text.c | 96 | ||||
| -rw-r--r-- | common/examples.js | 3 | ||||
| -rw-r--r-- | images/raylibtech/rfileimager_128x128.png | bin | 0 -> 1000 bytes | |||
| -rw-r--r-- | images/raylibtech/rtexteditor_128x128.png | bin | 0 -> 993 bytes | |||
| -rw-r--r-- | index.html | 4 | ||||
| -rw-r--r-- | robots.txt | 5 |
6 files changed, 52 insertions, 56 deletions
diff --git a/cheatsheet/raylib_text.c b/cheatsheet/raylib_text.c index 4814407..3f23142 100644 --- a/cheatsheet/raylib_text.c +++ b/cheatsheet/raylib_text.c @@ -1,54 +1,54 @@ -// Font loading/unloading functions -Font GetFontDefault(void); // Get the default Font -Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set -Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) -Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use -Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info -void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) -void UnloadFont(Font font); // Unload font from GPU memory (VRAM) -bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success + // Font loading/unloading functions + Font GetFontDefault(void); // Get the default Font + Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) + Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set + Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) + Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' + GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use + Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info + void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) + void UnloadFont(Font font); // Unload font from GPU memory (VRAM) + bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success -// Text drawing functions -void DrawFPS(int posX, int posY); // Draw current FPS -void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters -void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) -void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) -void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) + // Text drawing functions + void DrawFPS(int posX, int posY); // Draw current FPS + void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) + void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters + void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) + void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) + void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) -// Text font info functions -int MeasureText(const char *text, int fontSize); // Measure string width for default font -Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font -int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found -GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found -Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found + // Text font info functions + int MeasureText(const char *text, int fontSize); // Measure string width for default font + Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font + int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found + GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found + Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found -// Text codepoints management functions (unicode characters) -int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter -void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory -int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string -int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) -char *TextCodepointsToUTF8(const int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) + // Text codepoints management functions (unicode characters) + int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter + void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory + int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string + int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure + const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) + char *TextCodepointsToUTF8(const int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) -// Text strings management functions (no UTF-8 strings, only byte chars) -// NOTE: Some strings allocate memory internally for returned strings, just be careful! -int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied -bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal -unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending -const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) -const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string -char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) -char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) -const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter -const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings -void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! -int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string -const char *TextToUpper(const char *text); // Get upper case version of provided string -const char *TextToLower(const char *text); // Get lower case version of provided string -const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string -int TextToInteger(const char *text); // Get integer value from text (negative values not supported) + // Text strings management functions (no UTF-8 strings, only byte chars) + // NOTE: Some strings allocate memory internally for returned strings, just be careful! + int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied + bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal + unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending + const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) + const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string + char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) + char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) + const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter + const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings + void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! + int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string + const char *TextToUpper(const char *text); // Get upper case version of provided string + const char *TextToLower(const char *text); // Get lower case version of provided string + const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string + int TextToInteger(const char *text); // Get integer value from text (negative values not supported) diff --git a/common/examples.js b/common/examples.js index dd03011..535a641 100644 --- a/common/examples.js +++ b/common/examples.js @@ -32,8 +32,7 @@ $(document).ready(function() { '⭐️☆☆☆#core_basic_screen_manager', '⭐️⭐️⭐️⭐️#core_custom_frame_control', '⭐️⭐️⭐️☆#core_smooth_pixelperfect', - '⭐️⭐️⭐️⭐️#core_split_screen', - '⭐️⭐️☆☆#core_window_should_close', + '⭐️⭐️⭐️⭐️#core_split_screen', '⭐️☆☆☆#shapes_basic_shapes', '⭐️☆☆☆#shapes_bouncing_ball', '⭐️⭐️☆☆#shapes_colors_palette', diff --git a/images/raylibtech/rfileimager_128x128.png b/images/raylibtech/rfileimager_128x128.png Binary files differnew file mode 100644 index 0000000..83b93c9 --- /dev/null +++ b/images/raylibtech/rfileimager_128x128.png diff --git a/images/raylibtech/rtexteditor_128x128.png b/images/raylibtech/rtexteditor_128x128.png Binary files differnew file mode 100644 index 0000000..134dfa0 --- /dev/null +++ b/images/raylibtech/rtexteditor_128x128.png @@ -81,7 +81,7 @@ <a href="https://github.com/raysan5/raylib-games" target="_blank"><img class="icon" src="images/learning/games.png" title="raylib games" alt="raylib games" width="112" height="112"/></a> </div> </div> - <p>A part from those materials, there are plenty of tutorials created by the amazing raylib community. It's highly recommended to join the friendly<a href="https://discord.gg/raylib" target="_blank">raylib Discord Community</a> to stay up to date of latest raylib news and ask for help when required!</p> + <p>Apart from those materials, there are plenty of tutorials created by the amazing raylib community. It's highly recommended to join the friendly <a href="https://discord.gg/raylib" target="_blank">raylib Discord Community</a> to stay up to date of latest raylib news and ask for help when required!</p> <br> <h2>raylib awards</h2> <br> @@ -114,7 +114,7 @@ <br> <h2>raylib language bindings</h2> <br> - <p>You can use raylib with multiple programming languages, there are <a href="https://github.com/raysan5/raylib/blob/master/BINDINGS.md" target="_blank">+60 bindings</a>!. Here it is a list with some of them:</p> + <p>You can use raylib with multiple programming languages, there are <a href="https://github.com/raysan5/raylib/blob/master/BINDINGS.md" target="_blank">+60 bindings</a>! Here is a list with some of them:</p> <br> <div style="display: flex;"> <div id="bindings" style="margin: 0 auto;"> @@ -1,6 +1,3 @@ # robotstxt.org/ -User-agent: Twitterbot -Disallow: - -User-agent: * +Sitemap: https://raylib.com/sitemap.xml |
