10#include "ViewObject.h"
16 TEXT = 1 << (ViewObjectAttributeMax + 0),
17 APPEARANCE = 1 << (ViewObjectAttributeMax + 1),
19const int TextBoxAttributeMax = ViewObjectAttributeMax + 2;
63 virtual int draw()
override;
70 virtual int serialize(std::stringstream *p_ss,
unsigned int attr=0)
override;
76 virtual int deserialize(std::stringstream *p_ss,
unsigned int *p_a=NULL)
override;
void clearText()
Remove all text.
bool getWordWrap() const
Get word wrap.
std::string getText() const
Get text.
void setPadding(bool new_padding)
Set padding.
Vector getSize() const
Get size.
void setSize(df::Vector new_size)
Set size.
bool m_word_wrap
True to wrap lines at spaces.
Definition: TextBox.h:27
void setText(std::string new_text)
Set text, overwritting any current text.
void setWordWrap(bool new_word_wrap)
Set word wrap.
std::string m_text
Text in box.
Definition: TextBox.h:24
bool m_padding
True to pad rows from side bars.
Definition: TextBox.h:26
Vector m_size
Width (x), height (y), in spaces.
Definition: TextBox.h:25
void addText(std::string new_text)
Append text, adding to any current text.
bool getPadding() const
Get padding.
virtual int draw() override
Draw box and text.
virtual int serialize(std::stringstream *p_ss, unsigned int attr=0) override
Serialize attributes to stream.
virtual int deserialize(std::stringstream *p_ss, unsigned int *p_a=NULL) override
Deserialize stream to attributes and apply.
Definition: ViewObject.h:39
An animation for a sprite.
Definition: Animation.h:15
TextBoxAttribute
Categories of TextBox attributes that indicate modification.
Definition: TextBox.h:15