1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #ifndef TEXTRENDER_H
- #define TEXTRENDER_H
- #include <iostream>
- #include <map>
- #include <string>
- #include <SDL.h>
- #include <SDL_ttf.h>
- class LiteText;
- class TextRender
- {
- /// > Fonctions
- public:
- TextRender( std::string folder = "", Uint16 nbLiteTxts = 0, Uint16 fontSize = 65 );
- virtual ~TextRender();
- SDL_Surface* takeName( std::string nom );
- SDL_Surface* preLoadName( std::string nom, Uint8 r=0, Uint8 g=0, Uint8 b=0 );
- SDL_Surface* takeLite( Uint16 ID );
- SDL_Surface* tRendLite( Uint16 ID, std::string texte, Uint8 r=0, Uint8 g=0, Uint8 b=0 );
- LiteText* takeLiteObject( Uint16 ID );
- protected:
- SDL_Surface* brutLoadName( std::string nom, Uint8 r=0, Uint8 g=0, Uint8 b=0 );
- /// > Attributs
- protected:
- TTF_Font* m_police;
- const Uint16 m_liteTabSize;
- LiteText** m_liteTab;
- std::map<std::string, SDL_Surface*>::iterator m_it;
- std::map<std::string, SDL_Surface*> m_name;
- };
- class LiteText
- {
- /// > Fonctions
- public:
- LiteText( TTF_Font* police, std::string text = " " );
- ~LiteText();
- void render( std::string text, Uint8 r=0, Uint8 g=0, Uint8 b=0 );
- SDL_Surface* get();
- /// > Attributs
- private:
- SDL_Surface* m_text;
- TTF_Font* m_policeCopy;
- };
- #endif // TEXTRENDER_H
|