diff --git a/lib/Ray/sources/Drawables/2D/Text.cpp b/lib/Ray/sources/Drawables/2D/Text.cpp index 72a5086f..29da6b8f 100644 --- a/lib/Ray/sources/Drawables/2D/Text.cpp +++ b/lib/Ray/sources/Drawables/2D/Text.cpp @@ -8,13 +8,13 @@ #include "Drawables/2D/Text.hpp" RAY::Drawables::Drawables2D::Text::Text(const std::string &content, int fontSize, const Vector2 &position, const Color &color): - ADrawable2D(position, color), _text(content), _size(fontSize), _spacing(DEFAULT_LETTER_SPACING) + ADrawable2D(position, color), _text(content), _size(fontSize), _spacing(this->DefaultLetterSpacing) { this->_font.recs = nullptr; } RAY::Drawables::Drawables2D::Text::Text(const std::string &content, int fontSize, int x, int y, const Color &color): - ADrawable2D(x, y, color), _text(content), _size(fontSize), _spacing(DEFAULT_LETTER_SPACING) + ADrawable2D(x, y, color), _text(content), _size(fontSize), _spacing(this->DefaultLetterSpacing) { this->_font.recs = nullptr; } diff --git a/lib/Ray/sources/Drawables/2D/Text.hpp b/lib/Ray/sources/Drawables/2D/Text.hpp index e1fb8ca0..46e0bd37 100644 --- a/lib/Ray/sources/Drawables/2D/Text.hpp +++ b/lib/Ray/sources/Drawables/2D/Text.hpp @@ -11,13 +11,12 @@ #include "Drawables/ADrawable2D.hpp" #include -#define DEFAULT_LETTER_SPACING 1 - namespace RAY::Drawables::Drawables2D { //! @brief Text in a two-dimensionnal space class Text: public ADrawable2D { public: + static constexpr int DefaultLetterSpacing = 1; //! @brief Text constructor //! @param content text //! @param fontSize size of the text @@ -79,7 +78,8 @@ namespace RAY::Drawables::Drawables2D { int _size; //! @brief spacing of chars - int _spacing; + int _spacing; + }; }; diff --git a/lib/Ray/sources/Window.cpp b/lib/Ray/sources/Window.cpp index de8f08da..0bfe0147 100644 --- a/lib/Ray/sources/Window.cpp +++ b/lib/Ray/sources/Window.cpp @@ -112,12 +112,14 @@ void RAY::Window::setDrawingState(enum RAY::Window::drawingState state) void RAY::Window::useCamera(RAY::Camera::Camera2D &camera) { + this->unuseCamera(); this->_displayState = RAY::Window::TWO_DIMENSIONNAL; BeginMode2D(camera); } void RAY::Window::useCamera(RAY::Camera::Camera3D &camera) { + this->unuseCamera(); this->_displayState = RAY::Window::THREE_DIMENSIONNAL; BeginMode3D(camera); }