sdl2_impl 0.1.0
Vendor SDL2 2.32 : IGraphic2Module / IAudioModule
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
 
std::string getText () const override
 
void setFont (graphic::IFont *font) override
 
void setFontSize (unsigned int size) override
 
unsigned int getFontSize () const override
 
void setTextColor (Color color) override
 
Color getTextColor () const override
 
void setPosition (Vector2f position) override
 
Vector2f getPosition () const override
 
void setRotation (float angle) override
 
float getRotation () const override
 

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()

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

◆ ~SdlText()

SdlText::~SdlText ( )
inlineoverride

Member Function Documentation

◆ getFontSize()

unsigned int SdlText::getFontSize ( ) const
inlineoverride

◆ getPosition()

Vector2f SdlText::getPosition ( ) const
inlineoverride

◆ getRotation()

float SdlText::getRotation ( ) const
inlineoverride

◆ getText()

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

◆ getTextColor()

Color SdlText::getTextColor ( ) const
inlineoverride

◆ isReady()

bool SdlText::isReady ( ) const
inlineoverride

◆ setFont()

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

◆ setFontSize()

void SdlText::setFontSize ( unsigned int  size)
inlineoverride

◆ setPosition()

void SdlText::setPosition ( Vector2f  position)
inlineoverride

◆ setRotation()

void SdlText::setRotation ( float  angle)
inlineoverride

◆ setText()

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

◆ setTextColor()

void SdlText::setTextColor ( Color  color)
inlineoverride

Friends And Related Symbol Documentation

◆ SdlWindow

friend class SdlWindow
friend

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