(26639256a) - Added a method that automatically sets the text scale of a set of GUITextBlocks so that they all use the same scale and the text fits in all of the blocks. - Fixed TextBlock padding not being taken into account if the text is centered. - AutoScale and change the layout in a bunch of places where translated texts are likely to not fit.
This commit is contained in:
@@ -76,6 +76,11 @@ namespace Barotrauma
|
||||
get { return box; }
|
||||
}
|
||||
|
||||
public GUITextBlock TextBlock
|
||||
{
|
||||
get { return text; }
|
||||
}
|
||||
|
||||
public override string ToolTip
|
||||
{
|
||||
get { return base.ToolTip; }
|
||||
@@ -123,6 +128,7 @@ namespace Barotrauma
|
||||
private void ResizeBox()
|
||||
{
|
||||
box.RectTransform.NonScaledSize = new Point(RectTransform.NonScaledSize.Y);
|
||||
text.RectTransform.NonScaledSize = new Point(Rect.Width - box.Rect.Width, text.Rect.Height);
|
||||
text.RectTransform.AbsoluteOffset = new Point(box.Rect.Width, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user