raylib-cpp
C++ object-oriented wrapper library for raylib.
Text.hpp
1 
4 #ifndef RAYLIB_CPP_INCLUDE_TEXT_HPP_
5 #define RAYLIB_CPP_INCLUDE_TEXT_HPP_
6 
7 #include <string>
8 
9 #include "./raylib.hpp"
10 
14 #ifndef RLCPPAPI
15 #define RLCPPAPI static
16 #endif
17 
18 namespace raylib {
19 
23 RLCPPAPI inline void DrawText(
24  const std::string& title,
25  int posX,
26  int posY,
27  int fontSize,
28  ::Color color) {
29  ::DrawText(title.c_str(), posX, posY, fontSize, color);
30 }
31 
35 RLCPPAPI inline int MeasureText(const std::string& text, int fontSize) {
36  return ::MeasureText(text.c_str(), fontSize);
37 }
38 
42 RLCPPAPI inline bool TextIsEqual(const std::string& text1, const std::string& text2) {
43  return ::TextIsEqual(text1.c_str(), text2.c_str());
44 }
45 
49 RLCPPAPI inline unsigned int TextLength(const std::string& text) {
50  return ::TextLength(text.c_str());
51 }
52 
53 // TODO(RobLoach): Add remaining raylib C functions with string c_str() wrappers.
54 
55 } // namespace raylib
56 
57 #endif // RAYLIB_CPP_INCLUDE_TEXT_HPP_
raylib
All raylib-cpp classes and functions appear in the raylib namespace.
Definition: AudioDevice.hpp:7
raylib::TextIsEqual
static bool TextIsEqual(const std::string &text1, const std::string &text2)
Check if two text string are equal.
Definition: Text.hpp:42
raylib::MeasureText
static int MeasureText(const std::string &text, int fontSize)
Measure string width for default font.
Definition: Text.hpp:35
raylib::Color
Color type, RGBA (32bit)
Definition: Color.hpp:14
raylib::DrawText
static void DrawText(const std::string &title, int posX, int posY, int fontSize, ::Color color)
Draw text (using default font)
Definition: Text.hpp:23
raylib::TextLength
static unsigned int TextLength(const std::string &text)
Check if two text string are equal.
Definition: Text.hpp:49