diff --git a/CMakeLists.txt b/CMakeLists.txt
index e348769a..0318b98a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.11)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project (raylib_cpp
- VERSION 4.2.1
+ VERSION 4.2.2
DESCRIPTION "raylib-cpp C++ Object Oriented Wrapper for raylib"
HOMEPAGE_URL "https://github.com/robloach/raylib-cpp"
LANGUAGES C CXX)
diff --git a/clib.json b/clib.json
index 2e641342..f61d4ca4 100644
--- a/clib.json
+++ b/clib.json
@@ -1,6 +1,6 @@
{
"name": "raylib-cpp",
- "version": "4.2.1",
+ "version": "4.2.2",
"repo": "RobLoach/raylib-cpp",
"description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib",
"homepage": "https://github.com/robloach/raylib-cpp",
diff --git a/docs/_audio_stream_8hpp_source.html b/docs/_audio_stream_8hpp_source.html
index a5321710..503ff536 100644
--- a/docs/_audio_stream_8hpp_source.html
+++ b/docs/_audio_stream_8hpp_source.html
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/_font_8hpp_source.html b/docs/_font_8hpp_source.html
index e53b5263..25c6ebb8 100644
--- a/docs/_font_8hpp_source.html
+++ b/docs/_font_8hpp_source.html
@@ -106,7 +106,7 @@
- 55 Font(
const std::string& fileName,
int fontSize,
int* fontChars,
int charCount) {
+ 55 Font(
const std::string& fileName,
int fontSize,
int* fontChars = 0,
int charCount = 0) {
56 if (!
Load(fileName, fontSize, fontChars, charCount)) {
@@ -154,123 +154,126 @@
116 GETTERSETTER(::GlyphInfo*, Glyphs, glyphs)
118 Font& operator=(const ::
Font& font) {
-
-
-
-
- 123 Font& operator=(
const Font&) =
delete;
-
-
- 126 if (
this == &other) {
-
-
-
-
-
-
-
- 134 other.glyphCount = 0;
- 135 other.glyphPadding = 0;
-
- 137 other.recs =
nullptr;
- 138 other.glyphs =
nullptr;
-
-
-
-
- 152 bool Load(
const std::string& fileName) {
- 153 set(::LoadFont(fileName.c_str()));
-
-
-
- 167 bool Load(
const std::string& fileName,
int fontSize,
int* fontChars,
int charCount) {
- 168 set(::LoadFontEx(fileName.c_str(), fontSize, fontChars, charCount));
-
-
-
- 172 bool Load(const ::Image& image, ::
Color key,
int firstChar) {
- 173 set(::LoadFontFromImage(image, key, firstChar));
-
-
-
- 177 bool Load(
const std::string& fileType,
const unsigned char* fileData,
int dataSize,
int fontSize,
- 178 int *fontChars,
int charsCount) {
- 179 set(::LoadFontFromMemory(fileType.c_str(), fileData, dataSize, fontSize, fontChars,
-
-
-
-
-
- 188 float spacing, ::
Color tint = WHITE) {
- 189 ::DrawTextEx(*
this, text.c_str(), position, fontSize, spacing, tint);
-
-
-
-
- 194 const std::string& text,
-
-
-
-
-
- 200 ::
Color tint = WHITE) {
- 201 ::DrawTextPro(*
this, text.c_str(), position, origin, rotation, fontSize, spacing, tint);
-
-
-
-
-
-
- 211 ::
Color tint = { 255, 255, 255, 255 }) {
- 212 ::DrawTextCodepoint(*
this, codepoint, position, fontSize, tint);
-
-
-
-
- 220 return ::MeasureTextEx(*
this, text.c_str(), fontSize, spacing);
-
-
-
- 227 return ::GetGlyphIndex(*
this, character);
-
-
- 233 inline ::Image
ImageText(
const std::string& text,
float fontSize,
- 234 float spacing, ::
Color tint)
const {
- 235 return ::ImageTextEx(*
this, text.c_str(), fontSize, spacing, tint);
-
-
-
- 239 void set(const ::Font& font) {
- 240 baseSize = font.baseSize;
- 241 glyphCount = font.glyphCount;
- 242 glyphPadding = font.glyphPadding;
- 243 texture = font.texture;
-
- 245 glyphs = font.glyphs;
-
-
-
-
- 250 #endif // RAYLIB_CPP_INCLUDE_FONT_HPP_
+
+
+
+
+
+ 124 Font& operator=(
const Font&) =
delete;
+
+ 126 Font& operator=(
Font&& other) noexcept {
+ 127 if (
this == &other) {
+
+
+
+
+
+
+
+ 135 other.glyphCount = 0;
+ 136 other.glyphPadding = 0;
+
+ 138 other.recs =
nullptr;
+ 139 other.glyphs =
nullptr;
+
+
+
+
+ 153 bool Load(
const std::string& fileName) {
+
+
+
+
+ 168 bool Load(
const std::string& fileName,
int fontSize,
int* fontChars,
int charCount) {
+ 169 set(::
LoadFontEx(fileName.c_str(), fontSize, fontChars, charCount));
+
+
+
+ 173 bool Load(const ::Image& image, ::
Color key,
int firstChar) {
+ 174 set(::LoadFontFromImage(image, key, firstChar));
+
+
+
+ 178 bool Load(
const std::string& fileType,
const unsigned char* fileData,
int dataSize,
int fontSize,
+ 179 int *fontChars,
int charsCount) {
+ 180 set(::LoadFontFromMemory(fileType.c_str(), fileData, dataSize, fontSize, fontChars,
+
+
+
+
+
+ 189 float spacing, ::
Color tint = WHITE) {
+ 190 ::DrawTextEx(*
this, text.c_str(), position, fontSize, spacing, tint);
+
+
+
+
+ 195 const std::string& text,
+
+
+
+
+
+ 201 ::
Color tint = WHITE) {
+ 202 ::DrawTextPro(*
this, text.c_str(), position, origin, rotation, fontSize, spacing, tint);
+
+
+
+
+
+
+ 212 ::
Color tint = { 255, 255, 255, 255 }) {
+ 213 ::DrawTextCodepoint(*
this, codepoint, position, fontSize, tint);
+
+
+
+
+ 221 return ::MeasureTextEx(*
this, text.c_str(), fontSize, spacing);
+
+
+
+ 228 return ::GetGlyphIndex(*
this, character);
+
+
+ 234 inline ::Image
ImageText(
const std::string& text,
float fontSize,
+ 235 float spacing, ::
Color tint)
const {
+ 236 return ::ImageTextEx(*
this, text.c_str(), fontSize, spacing, tint);
+
+
+
+ 240 void set(const ::Font& font) {
+ 241 baseSize = font.baseSize;
+ 242 glyphCount = font.glyphCount;
+ 243 glyphPadding = font.glyphPadding;
+ 244 texture = font.texture;
+
+ 246 glyphs = font.glyphs;
+
+
+
+
+ 251 #endif // RAYLIB_CPP_INCLUDE_FONT_HPP_
Font(const std::string &fileName)
Loads a Font from the given file.
All raylib-cpp classes and functions appear in the raylib namespace.
-Font & DrawText(const std::string &text, ::Vector2 position, float fontSize, float spacing, ::Color tint=WHITE)
Draw text using font and additional parameters.
+Font & DrawText(const std::string &text, ::Vector2 position, float fontSize, float spacing, ::Color tint=WHITE)
Draw text using font and additional parameters.
+static inline ::Font LoadFont(const std::string &fileName)
Load font from file (filename must include file extension)
Font(const ::Image &image, ::Color key, int firstChar)
Loads a Font from the given image with a color key.
-Font & DrawText(int codepoint, ::Vector2 position, float fontSize, ::Color tint={ 255, 255, 255, 255 })
Draw one character (codepoint)
+Font & DrawText(int codepoint, ::Vector2 position, float fontSize, ::Color tint={ 255, 255, 255, 255 })
Draw one character (codepoint)
Font(const std::string &fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount)
Loads a font from memory, based on the given file type and file data.
+Font(const std::string &fileName, int fontSize, int *fontChars=0, int charCount=0)
Loads a Font from the given file, with generation parameters.
static void DrawTextPro(const Font &font, const std::string &text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, ::Color tint)
Draw text using Font and pro parameters (rotation)
Font type, includes texture and charSet array data.
-int GetGlyphIndex(int character) const
Get index position for a unicode character on font.
+int GetGlyphIndex(int character) const
Get index position for a unicode character on font.
-Font(const std::string &fileName, int fontSize, int *fontChars, int charCount)
Loads a Font from the given file, with generation parameters.
-inline ::Image ImageText(const std::string &text, float fontSize, float spacing, ::Color tint) const
Create an image from text (custom sprite font)
-bool Load(const std::string &fileName, int fontSize, int *fontChars, int charCount)
Loads a font from a given file with generation parameters.
+static inline ::Font LoadFontEx(const std::string &fileName, int fontSize, int *fontChars, int charsCount)
Load font from file (filename must include file extension)
+inline ::Image ImageText(const std::string &text, float fontSize, float spacing, ::Color tint) const
Create an image from text (custom sprite font)
+bool Load(const std::string &fileName, int fontSize, int *fontChars, int charCount)
Loads a font from a given file with generation parameters.
-Vector2 MeasureText(const std::string &text, float fontSize, float spacing) const
Measure string size for Font.
-bool Load(const std::string &fileName)
Loads a font from a given file.
+Vector2 MeasureText(const std::string &text, float fontSize, float spacing) const
Measure string size for Font.
+bool Load(const std::string &fileName)
Loads a font from a given file.
Exception used for most raylib-related exceptions.
static void DrawTextEx(const Font &font, const std::string &text, Vector2 position, float fontSize, float spacing, ::Color tint)
Draw text using font and additional parameters.
diff --git a/docs/_functions_8hpp_source.html b/docs/_functions_8hpp_source.html
index ef0979eb..49eb1fe4 100644
--- a/docs/_functions_8hpp_source.html
+++ b/docs/_functions_8hpp_source.html
@@ -242,87 +242,96 @@
273 ::DrawTextPro(font, text.c_str(), position, origin, rotation, fontSize, spacing, tint);
- 279 RLCPPAPI
inline int MeasureText(
const std::string& text,
int fontSize) {
- 280 return ::MeasureText(text.c_str(), fontSize);
+ 279 RLCPPAPI inline ::Font
LoadFont(
const std::string& fileName) {
+ 280 return ::LoadFont(fileName.c_str());
- 286 RLCPPAPI
inline bool TextIsEqual(
const std::string& text1,
const std::string& text2) {
- 287 return ::TextIsEqual(text1.c_str(), text2.c_str());
+ 286 RLCPPAPI inline ::Font
LoadFontEx(
const std::string& fileName,
int fontSize,
int *fontChars,
int charsCount) {
+ 287 return ::LoadFontEx(fileName.c_str(), fontSize, fontChars, charsCount);
- 293 RLCPPAPI
inline unsigned int TextLength(
const std::string& text) {
- 294 return ::TextLength(text.c_str());
+ 293 RLCPPAPI
inline int MeasureText(
const std::string& text,
int fontSize) {
+ 294 return ::MeasureText(text.c_str(), fontSize);
- 300 RLAPI
inline std::string
TextSubtext(
const std::string& text,
int position,
int length) {
- 301 return ::TextSubtext(text.c_str(), position, length);
+ 300 RLCPPAPI
inline bool TextIsEqual(
const std::string& text1,
const std::string& text2) {
+ 301 return ::TextIsEqual(text1.c_str(), text2.c_str());
- 307 RLAPI
inline std::string
TextReplace(
const std::string& text,
const std::string& replace,
const std::string& by) {
- 308 const char* input = text.c_str();
- 309 char* output =
::TextReplace(
const_cast<char*
>(input), replace.c_str(), by.c_str());
- 310 if (output != NULL) {
- 311 std::string stringOutput(output);
-
-
-
-
+ 307 RLCPPAPI
inline unsigned int TextLength(
const std::string& text) {
+ 308 return ::TextLength(text.c_str());
+
+
+ 314 RLAPI
inline std::string
TextSubtext(
const std::string& text,
int position,
int length) {
+ 315 return ::TextSubtext(text.c_str(), position, length);
- 321 RLAPI
inline std::string
TextInsert(
const std::string& text,
const std::string& insert,
int position) {
- 322 char* output =
::TextInsert(text.c_str(), insert.c_str(), position);
- 323 if (output != NULL) {
- 324 std::string stringOutput(output);
-
-
-
-
-
-
- 334 RLAPI
inline int TextFindIndex(
const std::string& text,
const std::string& find) {
- 335 return ::TextFindIndex(text.c_str(), find.c_str());
-
-
-
- 342 return ::TextToUpper(text.c_str());
+ 321 RLAPI
inline std::string
TextReplace(
const std::string& text,
const std::string& replace,
const std::string& by) {
+ 322 const char* input = text.c_str();
+ 323 char* output =
::TextReplace(
const_cast<char*
>(input), replace.c_str(), by.c_str());
+ 324 if (output != NULL) {
+ 325 std::string stringOutput(output);
+
+
+
+
+
+
+ 335 RLAPI
inline std::string
TextInsert(
const std::string& text,
const std::string& insert,
int position) {
+ 336 char* output =
::TextInsert(text.c_str(), insert.c_str(), position);
+ 337 if (output != NULL) {
+ 338 std::string stringOutput(output);
+
+
+
+
-
- 349 return ::TextToLower(text.c_str());
+ 348 RLAPI
inline int TextFindIndex(
const std::string& text,
const std::string& find) {
+ 349 return ::TextFindIndex(text.c_str(), find.c_str());
-
- 356 return ::TextToPascal(text.c_str());
+
+ 356 return ::TextToUpper(text.c_str());
-
- 363 return ::TextToInteger(text.c_str());
+
+ 363 return ::TextToLower(text.c_str());
-
-
- 368 #endif // RAYLIB_CPP_INCLUDE_FUNCTIONS_HPP_
+
+ 370 return ::TextToPascal(text.c_str());
+
+
+
+ 377 return ::TextToInteger(text.c_str());
+
+
+
+
+ 382 #endif // RAYLIB_CPP_INCLUDE_FUNCTIONS_HPP_
-RLAPI std::string TextToPascal(const std::string &text)
Get Pascal case notation version of provided string.
+RLAPI std::string TextToPascal(const std::string &text)
Get Pascal case notation version of provided string.
All raylib-cpp classes and functions appear in the raylib namespace.
static inline ::Image LoadImage(const std::string &fileName)
Load an image.
static std::string GetFileName(const std::string &filePath)
Get pointer to filename for a path string.
static void UpdateCamera(const ::Camera &camera)
Update camera depending on selected mode.
-RLAPI int TextFindIndex(const std::string &text, const std::string &find)
Find first text occurrence within a string.
+RLAPI int TextFindIndex(const std::string &text, const std::string &find)
Find first text occurrence within a string.
static inline ::Image LoadImageRaw(const std::string &fileName, int width, int height, int format, int headerSize)
Load an image from RAW file data.
static std::string GetPrevDirectoryPath(const std::string &dirPath)
Get previous directory path for a given path.
-static bool TextIsEqual(const std::string &text1, const std::string &text2)
Check if two text string are equal.
+static bool TextIsEqual(const std::string &text1, const std::string &text2)
Check if two text string are equal.
static inline ::Image LoadImageFromMemory(const std::string &fileType, const unsigned char *fileData, int dataSize)
Load image from memory buffer, fileType refers to extension like "png".
static void SetWindowTitle(const std::string &title)
Set title for window.
Image type, bpp always RGBA (32bit)
static std::string GetMonitorName(int monitor=0)
Get the human-readable, UTF-8 encoded name of the primary monitor.
static inline ::Image LoadImageAnim(const std::string &fileName, int *frames)
Load animated image data.
-RLAPI std::string TextToUpper(const std::string &text)
Get upper case version of provided string.
+static inline ::Font LoadFont(const std::string &fileName)
Load font from file (filename must include file extension)
+RLAPI std::string TextToUpper(const std::string &text)
Get upper case version of provided string.
static long GetFileModTime(const std::string &fileName)
Get file modification time (last write time)
static void TakeScreenshot(const std::string &fileName)
Takes a screenshot of current screen (saved a .png)
static std::vector< std::string > GetDroppedFiles()
Get dropped files names.
static std::string GetGamepadName(int gamepad)
Get gamepad internal name id.
-RLAPI std::string TextSubtext(const std::string &text, int position, int length)
Get text length, checks for '\0' ending.
+RLAPI std::string TextSubtext(const std::string &text, int position, int length)
Get text length, checks for '\0' ending.
static void InitWindow(int width, int height, const std::string &title="raylib")
Initialize window and OpenGL context.
static bool ExportImageAsCode(const Image &image, const std::string &fileName)
Export image as code file (.h) defining an array of bytes.
Camera type, defines a camera position/orientation in 3d space.
@@ -337,22 +346,23 @@
static bool ExportImage(const Image &image, const std::string &fileName)
Export image data to file.
static bool ChangeDirectory(const std::string &dir)
Change working directory, return true on success.
-static int MeasureText(const std::string &text, int fontSize)
Measure string width for default font.
-RLAPI std::string TextReplace(const std::string &text, const std::string &replace, const std::string &by)
Replace text string.
+static int MeasureText(const std::string &text, int fontSize)
Measure string width for default font.
+RLAPI std::string TextReplace(const std::string &text, const std::string &replace, const std::string &by)
Replace text string.
static void SetClipboardText(const std::string &text)
Set clipboard text content.
+static inline ::Font LoadFontEx(const std::string &fileName, int fontSize, int *fontChars, int charsCount)
Load font from file (filename must include file extension)
static std::string GetFileExtension(const std::string &fileName)
Get pointer to extension for a filename string (including point: ".png")
static bool SaveFileText(const std::string &fileName, const std::string &text)
Save text data to file (write)
-RLAPI std::string TextToLower(const std::string &text)
Get lower case version of provided string.
+RLAPI std::string TextToLower(const std::string &text)
Get lower case version of provided string.
static void DrawText(const std::string &text, int posX, int posY, int fontSize, ::Color color)
Draw text (using default font)
static std::string LoadFileText(const std::string &fileName)
Load text data from file (read)
static void OpenURL(const std::string &url)
Open URL with default system browser (if available)
-static unsigned int TextLength(const std::string &text)
Check if two text string are equal.
+static unsigned int TextLength(const std::string &text)
Check if two text string are equal.
static void DrawTextEx(const Font &font, const std::string &text, Vector2 position, float fontSize, float spacing, ::Color tint)
Draw text using font and additional parameters.
static std::string GetWorkingDirectory()
Get current working directory.
-RLAPI std::string TextInsert(const std::string &text, const std::string &insert, int position)
Insert text in a position.
+RLAPI std::string TextInsert(const std::string &text, const std::string &insert, int position)
Insert text in a position.
static std::string GetClipboardText()
Get clipboard text content.
-RLAPI int TextToInteger(const std::string &text)
Get integer value from text (negative values not supported)
+RLAPI int TextToInteger(const std::string &text)
Get integer value from text (negative values not supported)