wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wEngine::FontComponent Class Reference

Holds a reference to an SFML font for rendering text. More...

#include <wFontComponent.hpp>

Inheritance diagram for wEngine::FontComponent:
Inheritance graph

Public Member Functions

 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.
Public Member Functions inherited from wEngine::Component
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.
EntitygetParent () const
 Returns the parent entity of this component.

Additional Inherited Members

Protected Member Functions inherited from wEngine::Component
 Component ()
 Protected constructor to restrict instantiation to derived classes.

Detailed Description

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

Constructor & Destructor Documentation

◆ FontComponent()

wEngine::FontComponent::FontComponent ( const sf::Font & font)
explicit

Constructs the FontComponent with a reference to the font.

Parameters
fontReference to an externally managed sf::Font.

◆ ~FontComponent()

wEngine::FontComponent::~FontComponent ( )
overridedefault

Virtual destructor.

Member Function Documentation

◆ 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
fontReference 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: