Load GUI from XML

This commit is contained in:
2015-03-10 00:48:25 +01:00
parent 9d7dd452c7
commit 884fd8bb52
21 changed files with 1019 additions and 119 deletions

View File

@@ -10,8 +10,9 @@ class Font;
class TextWidget final : public Widget {
public:
TextWidget(Font& font, std::string text = "",
int width = WRAP_CONTENT, int height = WRAP_CONTENT);
TextWidget(TTF_Font *font, std::string text = "",
int width = WRAP_CONTENT, int height = WRAP_CONTENT,
std::string name = "");
TextWidget(TextWidget const& copy) = delete;
TextWidget& operator=(TextWidget const& copy) = delete;
@@ -26,11 +27,11 @@ public:
void render(SDL_Surface *dst, SDL_Rect *dstRect) const override;
protected:
void layout() override;
void layout(Widget* caller = nullptr) override;
private:
std::string text_;
Font& font_;
TTF_Font *font_;
SDLSurfaceUPtr textSurf_;
};