RType
Public Member Functions | List of all members
TextComponent Class Reference

#include <TextComponent.hpp>

Inheritance diagram for TextComponent:
Inheritance graph
[legend]
Collaboration diagram for TextComponent:
Collaboration graph
[legend]

Public Member Functions

 TextComponent (ClientCore *core, std::shared_ptr< ClientSocket > socket)
 Construct a new Text Component:: Text Component object. More...
 
void display (sf::RenderWindow &window) override
 display the text More...
 
void action () override
 action More...
 
void setText (std::string text)
 setText, set the text More...
 
void setFont (const sf::Font &font)
 setFont, set the font More...
 
void setPosition (sf::Vector2f position)
 setPosition, set the position More...
 
void setColor (sf::Color color)
 setColor, set the color More...
 
void setSize (unsigned int size)
 setSize, set the size More...
 
void handleEvent (const sf::Event &event, sf::RenderWindow &window) override
 handleEvent More...
 
- Public Member Functions inherited from AComponent
 AComponent (ClientCore *clientCore)
 AComponent, constructor of AComponent. More...
 
 ~AComponent () override=default
 ~AComponent, destructor of AComponent More...
 
ComponentType getType () const override
 getType, get the type of the component More...
 
void addActionTarget (std::shared_ptr< IComponent > component) override
 addActionTarget, add a target to the action More...
 
void addSubComponent (std::shared_ptr< IComponent > component) override
 addSubComponent, add a sub component More...
 
void setAttribute (std::string attribute) override
 setAttribute, set the attribute More...
 
std::string getAttribute () override
 getAttribute, get the attribute More...
 
- Public Member Functions inherited from IComponent
 IComponent (ClientCore *clientCore)
 IComponent, constructor of IComponent. More...
 
virtual ~IComponent ()=default
 ~IComponent, destructor of IComponent More...
 

Additional Inherited Members

- Protected Attributes inherited from IComponent
std::string _attribute
 
ComponentType _type
 
std::vector< std::shared_ptr< IComponent > > action_target
 
std::vector< std::shared_ptr< IComponent > > sub_components
 
ClientCore_clientCore
 

Detailed Description

Definition at line 15 of file TextComponent.hpp.

Constructor & Destructor Documentation

◆ TextComponent()

TextComponent::TextComponent ( ClientCore core,
std::shared_ptr< ClientSocket socket 
)
explicit

Construct a new Text Component:: Text Component object.

Parameters
core
socket

Definition at line 18 of file TextComponent.cpp.

References IComponent::_attribute, IComponent::_type, AComponent::AComponent(), and TEXT.

Here is the call graph for this function:

Member Function Documentation

◆ action()

void TextComponent::action ( )
overridevirtual

action

Implements IComponent.

Definition at line 36 of file TextComponent.cpp.

◆ display()

void TextComponent::display ( sf::RenderWindow &  window)
overridevirtual

display the text

display, display the text

Parameters
window

Implements IComponent.

Definition at line 94 of file TextComponent.cpp.

◆ handleEvent()

void TextComponent::handleEvent ( const sf::Event event,
sf::RenderWindow &  window 
)
overridevirtual

handleEvent

Parameters
event
window

Implements IComponent.

Definition at line 99 of file TextComponent.cpp.

◆ setColor()

void TextComponent::setColor ( sf::Color  color)

setColor, set the color

Parameters
color

Definition at line 74 of file TextComponent.cpp.

◆ setFont()

void TextComponent::setFont ( const sf::Font &  font)

setFont, set the font

Parameters
font

Definition at line 54 of file TextComponent.cpp.

◆ setPosition()

void TextComponent::setPosition ( sf::Vector2f  position)

setPosition, set the position

Parameters
position

Definition at line 64 of file TextComponent.cpp.

◆ setSize()

void TextComponent::setSize ( unsigned int  size)

setSize, set the size

Parameters
size

Definition at line 84 of file TextComponent.cpp.

◆ setText()

void TextComponent::setText ( std::string  text)

setText, set the text

Parameters
text

Definition at line 44 of file TextComponent.cpp.


The documentation for this class was generated from the following files: