P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
Loading...
Searching...
No Matches
SdlText Class Reference

Une chaine rendue en texture, refaite quand elle change. More...

#include <SdlText.hpp>

Inheritance diagram for SdlText:
Collaboration diagram for SdlText:

Public Member Functions

 SdlText (std::string data, SdlFont &font)
 ~SdlText () override
bool isReady () const override
void setText (const std::string text) override
 Set the Text value.
std::string getText () const override
 Get the Text value.
void setFont (graphic::IFont *font) override
 Set the Font value - a loaded IFont, not a path, so changing font never implies a reload from disk.
void setFontSize (unsigned int size) override
 Set the Font Size text.
unsigned int getFontSize () const override
 Get the Font Size text.
void setTextColor (Color color) override
 Set the Text Color text.
Color getTextColor () const override
 Get the Text Color text.
void setPosition (Vector2f position) override
 Set the Position text.
Vector2f getPosition () const override
 Get the Position text.
void setRotation (float angle) override
 Set the Rotation object.
float getRotation () const override
 Get the Rotation object.
 SdlText (std::string data, SdlFont &font)
 ~SdlText () override
bool isReady () const override
void setText (const std::string text) override
 Set the Text value.
std::string getText () const override
 Get the Text value.
void setFont (graphic::IFont *font) override
 Set the Font value - a loaded IFont, not a path, so changing font never implies a reload from disk.
void setFontSize (unsigned int size) override
 Set the Font Size text.
unsigned int getFontSize () const override
 Get the Font Size text.
void setTextColor (Color color) override
 Set the Text Color text.
Color getTextColor () const override
 Get the Text Color text.
void setPosition (Vector2f position) override
 Set the Position text.
Vector2f getPosition () const override
 Get the Position text.
void setRotation (float angle) override
 Set the Rotation object.
float getRotation () const override
 Get the Rotation object.
Public Member Functions inherited from graphic::IText
virtual ~IText ()=default
 Destroy the IText object.

Friends

class SdlWindow

Detailed Description

Une chaine rendue en texture, refaite quand elle change.

SDL_ttf rend vers une SDL_Surface, qu'il faut televerser en SDL_Texture pour la dessiner - une opration bien trop chere pour chaque frame. On garde donc la texture et un drapeau : tant que ni le texte, ni la police, ni le corps, ni la couleur ne bougent, on redessine la meme.

Comme SdlTexture, la construction attend le premier dessin : c'est la seule ou le renderer est connu.

Constructor & Destructor Documentation

◆ SdlText() [1/2]

SdlText::SdlText ( std::string data,
SdlFont & font )
inline

◆ ~SdlText() [1/2]

SdlText::~SdlText ( )
inlineoverride

◆ SdlText() [2/2]

SdlText::SdlText ( std::string data,
SdlFont & font )
inline

◆ ~SdlText() [2/2]

SdlText::~SdlText ( )
inlineoverride

Member Function Documentation

◆ getFontSize() [1/2]

unsigned int SdlText::getFontSize ( ) const
inlineoverridevirtual

Get the Font Size text.

Returns
unsigned int

Implements graphic::IText.

◆ getFontSize() [2/2]

unsigned int SdlText::getFontSize ( ) const
inlineoverridevirtual

Get the Font Size text.

Returns
unsigned int

Implements graphic::IText.

◆ getPosition() [1/2]

Vector2f SdlText::getPosition ( ) const
inlineoverridevirtual

Get the Position text.

Returns
Vector2f

Implements graphic::IText.

◆ getPosition() [2/2]

Vector2f SdlText::getPosition ( ) const
inlineoverridevirtual

Get the Position text.

Returns
Vector2f

Implements graphic::IText.

◆ getRotation() [1/2]

float SdlText::getRotation ( ) const
inlineoverridevirtual

Get the Rotation object.

Returns
float

Implements graphic::IText.

◆ getRotation() [2/2]

float SdlText::getRotation ( ) const
inlineoverridevirtual

Get the Rotation object.

Returns
float

Implements graphic::IText.

◆ getText() [1/2]

std::string SdlText::getText ( ) const
inlineoverridevirtual

Get the Text value.

Returns
std::string

Implements graphic::IText.

◆ getText() [2/2]

std::string SdlText::getText ( ) const
inlineoverridevirtual

Get the Text value.

Returns
std::string

Implements graphic::IText.

◆ getTextColor() [1/2]

Color SdlText::getTextColor ( ) const
inlineoverridevirtual

Get the Text Color text.

Returns
Color

Implements graphic::IText.

◆ getTextColor() [2/2]

Color SdlText::getTextColor ( ) const
inlineoverridevirtual

Get the Text Color text.

Returns
Color

Implements graphic::IText.

◆ isReady() [1/2]

bool SdlText::isReady ( ) const
inlineoverridevirtual

Implements graphic::IText.

◆ isReady() [2/2]

bool SdlText::isReady ( ) const
inlineoverridevirtual

Implements graphic::IText.

◆ setFont() [1/2]

void SdlText::setFont ( graphic::IFont * font)
inlineoverridevirtual

Set the Font value - a loaded IFont, not a path, so changing font never implies a reload from disk.

Parameters
font

Implements graphic::IText.

◆ setFont() [2/2]

void SdlText::setFont ( graphic::IFont * font)
inlineoverridevirtual

Set the Font value - a loaded IFont, not a path, so changing font never implies a reload from disk.

Parameters
font

Implements graphic::IText.

◆ setFontSize() [1/2]

void SdlText::setFontSize ( unsigned int size)
inlineoverridevirtual

Set the Font Size text.

Parameters
size

Implements graphic::IText.

◆ setFontSize() [2/2]

void SdlText::setFontSize ( unsigned int size)
inlineoverridevirtual

Set the Font Size text.

Parameters
size

Implements graphic::IText.

◆ setPosition() [1/2]

void SdlText::setPosition ( Vector2f position)
inlineoverridevirtual

Set the Position text.

Parameters
position

Implements graphic::IText.

◆ setPosition() [2/2]

void SdlText::setPosition ( Vector2f position)
inlineoverridevirtual

Set the Position text.

Parameters
position

Implements graphic::IText.

◆ setRotation() [1/2]

void SdlText::setRotation ( float angle)
inlineoverridevirtual

Set the Rotation object.

Parameters
angle

Implements graphic::IText.

◆ setRotation() [2/2]

void SdlText::setRotation ( float angle)
inlineoverridevirtual

Set the Rotation object.

Parameters
angle

Implements graphic::IText.

◆ setText() [1/2]

void SdlText::setText ( const std::string text)
inlineoverridevirtual

Set the Text value.

Parameters
text

Implements graphic::IText.

◆ setText() [2/2]

void SdlText::setText ( const std::string text)
inlineoverridevirtual

Set the Text value.

Parameters
text

Implements graphic::IText.

◆ setTextColor() [1/2]

void SdlText::setTextColor ( Color color)
inlineoverridevirtual

Set the Text Color text.

Parameters
color

Implements graphic::IText.

◆ setTextColor() [2/2]

void SdlText::setTextColor ( Color color)
inlineoverridevirtual

Set the Text Color text.

Parameters
color

Implements graphic::IText.

◆ SdlWindow

SdlWindow
friend

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