|
|
@@ -62,6 +62,32 @@ namespace oxygine
|
|
|
float outline;//works only with SD fonts, disabled by default = 0.0f, 0.5 - max outline
|
|
|
Color outlineColor;//works only with SD fonts
|
|
|
float weight;//works only with SD fonts, font weight, default = 0.5f, 0.0 - bold, 1.0 - thin
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ TextStyle withFont(const Font* f) const { TextStyle st = *this; st.font = f; return st; }
|
|
|
+
|
|
|
+ TextStyle alignTop() const { TextStyle st = *this; st.vAlign = VALIGN_TOP; return st; }
|
|
|
+ TextStyle alignBottom() const { TextStyle st = *this; st.vAlign = VALIGN_BOTTOM; return st; }
|
|
|
+ TextStyle alignBaseline() const { TextStyle st = *this; st.vAlign = VALIGN_BASELINE; return st; }
|
|
|
+ TextStyle alignMiddleV() const { TextStyle st = *this; st.vAlign = VALIGN_MIDDLE; return st; }
|
|
|
+
|
|
|
+ TextStyle alignLeft() const { TextStyle st = *this; st.hAlign = HALIGN_LEFT; return st; }
|
|
|
+ TextStyle alignRight() const { TextStyle st = *this; st.hAlign = HALIGN_RIGHT; return st; }
|
|
|
+ TextStyle alignMiddleH() const { TextStyle st = *this; st.hAlign = HALIGN_MIDDLE; return st; }
|
|
|
+
|
|
|
+ TextStyle alignMiddle() const { TextStyle st = *this; st.vAlign = VALIGN_MIDDLE; st.hAlign = HALIGN_MIDDLE; return st; }
|
|
|
+
|
|
|
+ TextStyle withHOffset(int offset) const { TextStyle st = *this; st.linesOffset = offset; return st; }
|
|
|
+ TextStyle withKerning(int kerning) const { TextStyle st = *this; st.kerning = kerning; return st; }
|
|
|
+ TextStyle withMultiline(bool multiline = true) const { TextStyle st = *this; st.multiline = multiline; return st; }
|
|
|
+ TextStyle withColor(const Color& color) const { TextStyle st = *this; st.color = color; return st; }
|
|
|
+
|
|
|
+ TextStyle withFontSize(int size) const { TextStyle st = *this; st.fontSize = size; return st; }
|
|
|
+
|
|
|
+ TextStyle withOutline(float outline) const { TextStyle st = *this; st.outline = outline; return st; }
|
|
|
+ TextStyle withOutlineColor(const Color& color) const { TextStyle st = *this; st.outlineColor = color; return st; }
|
|
|
+ TextStyle withWeight(float weight) const { TextStyle st = *this; st.weight = weight; return st; }
|
|
|
};
|
|
|
|
|
|
std::string dumpStyle(const TextStyle& s, bool onlydiff);
|