-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathText.h
More file actions
28 lines (25 loc) · 742 Bytes
/
Text.h
File metadata and controls
28 lines (25 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef TEXT_H
#define TEXT_H
#include "GraphicObject2D.h"
#include <SDL_ttf.h>
namespace ge{
class Text : GraphicObject2D
{
public:
static Text* getInstance(int posX, int posY, int width, int height, std::string font, int fontSize, std::string text);
~Text();
void setColor(SDL_Color newColor);
void setText(std::string newText);
void render();
private:
Text(int posX, int posY, int width, int height, std::string font, int fontSize, std::string text);
const Text& operator=(const Text&) = delete;
void UpdateTextues();
TTF_Font* font = nullptr;
SDL_Surface* surface = nullptr;
SDL_Texture* texture = nullptr;
SDL_Color color = { 255, 255, 255 };
std::string text;
};
}
#endif // !TEXT_H