Skip to content

Commit

Permalink
Add setFontColor(Rgba)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Sep 12, 2024
1 parent 3253a73 commit 8d5c38b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jngl/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ namespace jngl {

Rgba gFontColor{ 0, 0, 0, 1 };

void setFontColor(const Rgba color) {
gFontColor = color;
}

void setFontColor(const Rgb color, float alpha) {
gFontColor = Rgba(color, Alpha(alpha));
}
Expand Down
4 changes: 4 additions & 0 deletions src/jngl/font.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#pragma once

#include "Rgb.hpp"
#include "Rgba.hpp"
#include "Vec2.hpp"

#include <memory>
Expand Down Expand Up @@ -87,6 +88,9 @@ void setFont(const std::string& filename);
/// platforms.
void setFontByName(const std::string& name);

/// Sets the color and alpha value of the currently active font
void setFontColor(Rgba);

/// Sets the color of the currently active font and the alpha value
///
/// \a alpha goes from 0.0f to 1.0f (opaque). It's automatically clamped to these values.
Expand Down

0 comments on commit 8d5c38b

Please sign in to comment.