Skip to content

Commit

Permalink
Added simple UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubgorsky committed Jun 19, 2022
1 parent 630115a commit e94ff1d
Show file tree
Hide file tree
Showing 6 changed files with 859 additions and 182 deletions.
7 changes: 7 additions & 0 deletions headers/Text.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class Text {
Text() = default;
Text(const std::string &font_Path, int font_size, const std::string &message, const SDL_Color &color);

void setText(const std::string &message);
void setSize(int font_size);
void setFont(const std::string &font_Path);
void setColor(const SDL_Color &color);
void display(int x, int y) const;

static SDL_Texture* loadFont(const std::string &font_Path, int font_size, const std::string &message, const SDL_Color &color);
Expand All @@ -22,6 +26,9 @@ class Text {

protected:
private:
std::string path, message;
int font_size;
SDL_Color color;
SDL_Texture *textTexture = nullptr;
mutable SDL_Rect textRect{};
SDL_Rect *srcRect = nullptr;
Expand Down
Loading

0 comments on commit e94ff1d

Please sign in to comment.