|
JNGL
Easy to use cross-platform 2D game library
|
Same as jngl::Font but adds an outline. More...
#include <jngl/OutlinedFont.hpp>
Public Member Functions | |
| OutlinedFont (const std::string &filename, unsigned int size, float strokePercentage) | |
| Set strokePercentage to a positive value in %, e.g. 5 to add an outline of 5% to the font. | |
| void | print (const Mat3 &modelview, const std::string &text, jngl::Rgba innerColor, jngl::Rgba outerColor) const |
| Print text using modelview in innerColor and an outline in outerColor. | |
| void | printCentered (Mat3 modelview, const std::string &text, jngl::Rgba innerColor, jngl::Rgba outerColor) const |
| Print text using modelview in innerColor and an outline in outerColor. | |
| double | getTextWidth (std::string_view) const |
| Calculates the width of text in scale-independent pixels if it would be drawn with this font. | |
| std::shared_ptr< FontInterface > | bake (jngl::Rgba innerColor, jngl::Rgba outerColor) const |
| Creates a new FontInterface with pre-baked colors for the inner and outer (outline) text. | |
Same as jngl::Font but adds an outline.
Definition at line 14 of file OutlinedFont.hpp.
| std::shared_ptr< FontInterface > bake | ( | jngl::Rgba | innerColor, |
| jngl::Rgba | outerColor ) const |
Creates a new FontInterface with pre-baked colors for the inner and outer (outline) text.
| innerColor | The color to use for the main text |
| outerColor | The color to use for the outline |
Example: