mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-24 20:05:39 -04:00
Allow to set the text alignment for text objects by property (#4648)
This commit is contained in:
@@ -29,7 +29,8 @@ TextObject::TextObject()
|
||||
underlined(false),
|
||||
colorR(0),
|
||||
colorG(0),
|
||||
colorB(0)
|
||||
colorB(0),
|
||||
textAlignment("left")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -39,6 +40,7 @@ void TextObject::DoUnserializeFrom(gd::Project& project,
|
||||
const gd::SerializerElement& element) {
|
||||
SetString(element.GetChild("string", 0, "String").GetValue().GetString());
|
||||
SetFontName(element.GetChild("font", 0, "Font").GetValue().GetString());
|
||||
SetTextAlignment(element.GetChild("textAlignment").GetValue().GetString());
|
||||
SetCharacterSize(element.GetChild("characterSize", 0, "CharacterSize")
|
||||
.GetValue()
|
||||
.GetInt());
|
||||
@@ -56,6 +58,7 @@ void TextObject::DoUnserializeFrom(gd::Project& project,
|
||||
void TextObject::DoSerializeTo(gd::SerializerElement& element) const {
|
||||
element.AddChild("string").SetValue(GetString());
|
||||
element.AddChild("font").SetValue(GetFontName());
|
||||
element.AddChild("textAlignment").SetValue(GetTextAlignment());
|
||||
element.AddChild("characterSize").SetValue(GetCharacterSize());
|
||||
element.AddChild("color")
|
||||
.SetAttribute("r", (int)GetColorR())
|
||||
|
||||
Reference in New Issue
Block a user