(23ecb8f20) Fixed: Scaling past 1920x1080 for: Reactor UI, Submarine labels, loading tips, inventoryslot container status

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:20:54 +03:00
parent b0a8f0e5e1
commit 48070a3f90
20 changed files with 199 additions and 350 deletions
@@ -67,6 +67,7 @@ namespace Barotrauma
public static bool ScreenChanged;
public static ScalableFont Font => Style?.Font;
public static ScalableFont UnscaledSmallFont => Style?.UnscaledSmallFont;
public static ScalableFont SmallFont => Style?.SmallFont;
public static ScalableFont LargeFont => Style?.LargeFont;
public static ScalableFont VideoTitleFont => Style?.VideoTitleFont;
@@ -17,6 +17,7 @@ namespace Barotrauma
private ScalableFont defaultFont;
public ScalableFont Font { get; private set; }
public ScalableFont UnscaledSmallFont { get; private set; }
public ScalableFont SmallFont { get; private set; }
public ScalableFont LargeFont { get; private set; }
public ScalableFont VideoTitleFont { get; private set; }
@@ -64,6 +65,9 @@ namespace Barotrauma
case "font":
Font = LoadFont(subElement, graphicsDevice);
break;
case "unscaledsmallfont":
UnscaledSmallFont = LoadFont(subElement, graphicsDevice);
break;
case "smallfont":
SmallFont = LoadFont(subElement, graphicsDevice);
break;
@@ -203,10 +203,12 @@ namespace Barotrauma
{
string wrappedTip = ToolBox.WrapText(selectedTip, GameMain.GraphicsWidth * 0.5f, GUI.Font);
string[] lines = wrappedTip.Split('\n');
float lineHeight = GUI.Font.MeasureString(selectedTip).Y;
for (int i = 0; i < lines.Length; i++)
{
GUI.Font.DrawString(spriteBatch, lines[i],
new Vector2(GameMain.GraphicsWidth / 2.0f - GUI.Font.MeasureString(lines[i]).X / 2.0f, GameMain.GraphicsHeight * 0.78f + i * (15 * GUI.Scale)), Color.White);
new Vector2(GameMain.GraphicsWidth / 2.0f - GUI.Font.MeasureString(lines[i]).X / 2.0f, GameMain.GraphicsHeight * 0.78f + i * lineHeight), Color.White);
}
}