Load GUI from XML
This commit is contained in:
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user