Holds a reference to an SFML font for rendering text.
More...
#include <wFontComponent.hpp>
|
| FontComponent (const sf::Font &font) |
| Constructs the FontComponent with a reference to the font.
|
| ~FontComponent () override=default |
| Virtual destructor.
|
const sf::Font & | getFont () const |
| Returns the stored font reference.
|
void | setFont (const sf::Font &font) |
| Updates the stored font reference.
|
void | debugPrint () const |
| Prints debug information about the stored font.
|
virtual | ~Component ()=default |
virtual void | enable () |
virtual void | disable () |
bool | isEnabled () const |
| Checks whether the component is currently active.
|
void | setParent (Entity *parent) |
| Sets the parent entity of this component.
|
Entity * | getParent () const |
| Returns the parent entity of this component.
|
|
| Component () |
| Protected constructor to restrict instantiation to derived classes.
|
Holds a reference to an SFML font for rendering text.
This component allows entities to store and access an sf::Font reference without needing to pass the AssetManager explicitly.
- Note
- The font must outlive the entity that uses it.
- Author
- Wilfried Koch
- Copyright
- © 2025 Wilfried Koch. All rights reserved.
◆ FontComponent()
wEngine::FontComponent::FontComponent |
( |
const sf::Font & | font | ) |
|
|
explicit |
Constructs the FontComponent with a reference to the font.
- Parameters
-
font | Reference to an externally managed sf::Font. |
◆ ~FontComponent()
wEngine::FontComponent::~FontComponent |
( |
| ) |
|
|
overridedefault |
◆ getFont()
const sf::Font & wEngine::FontComponent::getFont |
( |
| ) |
const |
Returns the stored font reference.
- Returns
- A constant reference to the sf::Font.
◆ setFont()
void wEngine::FontComponent::setFont |
( |
const sf::Font & | font | ) |
|
Updates the stored font reference.
- Parameters
-
font | Reference to an externally managed sf::Font. |
- Note
- The font must outlive this component.
◆ debugPrint()
void wEngine::FontComponent::debugPrint |
( |
| ) |
const |
Prints debug information about the stored font.
The documentation for this class was generated from the following files: