mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-12-01 01:18:52 +00:00
Clean up font setting
This commit is contained in:
@@ -48,7 +48,7 @@ int main(void)
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
msg.SetFontSize(msg.GetFontSize() + GetMouseWheelMove() * 4.0f);
|
||||
msg.fontSize += GetMouseWheelMove() * 4.0f;
|
||||
|
||||
// Choose font texture filter method
|
||||
if (IsKeyPressed(KEY_ONE))
|
||||
@@ -76,8 +76,7 @@ int main(void)
|
||||
// Load a dropped TTF file dynamically (at current fontSize)
|
||||
for (const auto& file : raylib::GetDroppedFiles()) {
|
||||
if (raylib::IsFileExtension(file, ".ttf")) {
|
||||
font = raylib::Font(file, font.GetBaseSize());
|
||||
msg.SetFont(font);
|
||||
msg.font = font = raylib::Font(file, font.GetBaseSize());
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
@@ -64,7 +64,7 @@ class Text {
|
||||
*
|
||||
* @see DrawTextPro()
|
||||
*/
|
||||
inline void Draw(const ::Vector2& position, const Vector2& origin, float rotation = 0) {
|
||||
inline void Draw(const ::Vector2& position, float rotation, const Vector2& origin = {0, 0}) {
|
||||
::DrawTextPro(font, text.c_str(), position, origin, rotation, fontSize, spacing, color);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user