Fix window size.

This commit is contained in:
Dean Herbert 2016-09-20 16:26:07 +09:00
parent b9de26aa26
commit b2e7f290f2
1 changed files with 10 additions and 4 deletions

View File

@ -13,6 +13,7 @@
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores;
using osu.Framework.OS;
namespace osu.Game
{
@ -24,6 +25,13 @@ public class OsuGame : Framework.Game
internal APIAccess API;
public override void SetHost(BasicGameHost host)
{
base.SetHost(host);
host.Size = new Vector2(Config.Get<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height));
}
public override void Load()
{
base.Load();
@ -31,8 +39,6 @@ public override void Load()
//this completely overrides the framework default. will need to change once we make a proper FontStore.
Fonts = new TextureStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular")) { ScaleAdjust = 0.01f };
Parent.Size = new Vector2(Config.Get<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height));
API = new APIAccess()
{
Username = Config.Get<string>(OsuConfig.Username),
@ -73,8 +79,8 @@ public override bool Invalidate(Invalidation invalidation = Invalidation.All, Dr
if (Parent != null)
{
Parent.Width = Config.Set(OsuConfig.Width, ActualSize.X).Value;
Parent.Height = Config.Set(OsuConfig.Height, ActualSize.Y).Value;
Config.Set(OsuConfig.Width, ActualSize.X);
Config.Set(OsuConfig.Height, ActualSize.Y);
}
return true;
}