R-TYPE
Public Member Functions | List of all members
ECS::Text Class Reference

#include <Text.hpp>

Inheritance diagram for ECS::Text:
ECS::IComp

Public Member Functions

 Text (sf::Font &font, const std::string &sentence, int size, sf::Vector2f pos) noexcept
 
 Text (const Text &text) noexcept
 
 Text (Text &&) noexcept=delete
 
 ~Text () noexcept override=default
 
Textoperator= (const Text &) const noexcept=delete
 
Textoperator= (Text &&) const noexcept=delete
 
void setSentence (const std::string &text) noexcept
 
std::string getSentence () const noexcept
 
void setSizeText (int) noexcept
 
void setFont (sf::Font &font) noexcept
 
int getTextSize () const noexcept
 
sf::Text & getText () noexcept
 
sf::Font getFont () const noexcept
 
void setPosition (int x, int y) noexcept
 
void setPosition (sf::Vector2f pos) noexcept
 
sf::Vector2f getPosition () const noexcept
 
- Public Member Functions inherited from ECS::IComp
virtual ~IComp () noexcept=default
 

Constructor & Destructor Documentation

◆ Text() [1/3]

ECS::Text::Text ( sf::Font &  font,
const std::string &  sentence,
int  size,
sf::Vector2f  pos 
)
explicitnoexcept

It initializes the text object

Parameters
fontThe font that the text will use.
sentenceThe text you want to display
sizeThe size of the text.
posThe position of the text

◆ Text() [2/3]

ECS::Text::Text ( const Text text)
noexcept

It's a copy constructor

Parameters
textThe text to copy

◆ Text() [3/3]

ECS::Text::Text ( Text &&  )
explicitdeletenoexcept

◆ ~Text()

ECS::Text::~Text ( )
overridedefaultnoexcept

Member Function Documentation

◆ getFont()

sf::Font ECS::Text::getFont ( ) const
noexcept

Returns the font of the text.

Returns
A reference to the font.

◆ getPosition()

sf::Vector2f ECS::Text::getPosition ( ) const
noexcept

Returns the position of the text.

Returns
The position of the text.

◆ getSentence()

std::string ECS::Text::getSentence ( ) const
noexcept

It returns the sentence.

Returns
The sentence.

◆ getText()

sf::Text & ECS::Text::getText ( )
noexcept

It returns the text object.

Returns
A reference to the text object.

◆ getTextSize()

int ECS::Text::getTextSize ( ) const
noexcept

It returns the size of the text.

Returns
The text size.

◆ operator=() [1/2]

Text& ECS::Text::operator= ( const Text ) const
deletenoexcept

◆ operator=() [2/2]

Text& ECS::Text::operator= ( Text &&  ) const
deletenoexcept

◆ setFont()

void ECS::Text::setFont ( sf::Font &  font)
noexcept

It sets the font of the text object

Parameters
fontThe font to use for the text.

◆ setPosition() [1/2]

void ECS::Text::setPosition ( int  x,
int  y 
)
noexcept

It sets the position of the text object

Parameters
xThe x position of the text.
yThe y position of the text.

◆ setPosition() [2/2]

void ECS::Text::setPosition ( sf::Vector2f  pos)
noexcept

It sets the position of the text object

Parameters
posThe position of the text.

◆ setSentence()

void ECS::Text::setSentence ( const std::string &  sentence)
noexcept

It sets the sentence of the text

Parameters
sentenceThe string to be displayed.

◆ setSizeText()

void ECS::Text::setSizeText ( int  size)
noexcept

It sets the size of the text

Parameters
sizeThe size of the text.

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