protected override void Initialize() { Content.RootDirectory = ""; IsMouseVisible = true; PandaMonogameConfig.UISoundType = (int)SoundType.UI; #if DEBUG PandaMonogameConfig.Logging = true; IsFixedTimeStep = false; _graphics.SynchronizeWithVerticalRetrace = false; #endif ModManager.Instance.Init(Content); ModManager.Instance.LoadList("Mods", "mods.xml", "assets.xml"); SettingsManager.Instance.Load("Assets\\settings.xml"); _graphics.PreferredBackBufferWidth = SettingsManager.Instance.GetSetting <int>("window", "width"); _graphics.PreferredBackBufferHeight = SettingsManager.Instance.GetSetting <int>("window", "height"); _graphics.ApplyChanges(); ModManager.Instance.SoundManager.SetVolume((int)SoundType.Music, SettingsManager.Instance.GetSetting <float>("sound", "musicvolume")); ModManager.Instance.SoundManager.SetVolume((int)SoundType.SoundEffect, SettingsManager.Instance.GetSetting <float>("sound", "sfxvolume")); ModManager.Instance.SoundManager.SetVolume((int)SoundType.UI, SettingsManager.Instance.GetSetting <float>("sound", "uivolume")); Globals.Load(GraphicsDevice); PUITooltipManager.Setup(GraphicsDevice, Globals.DefaultFont); Window.TextInput += Window_TextInput; base.Initialize(); }
public override void Draw(GameTime gameTime, GraphicsDevice graphics, SpriteBatch spriteBatch) { graphics.Clear(Color.Black); // screen space spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, blendState: BlendState.AlphaBlend, samplerState: SamplerState.PointClamp); { WorldManager.DrawScreen(spriteBatch); } spriteBatch.End(); // world space spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, blendState: BlendState.AlphaBlend, samplerState: SamplerState.PointClamp, transformMatrix: Camera.GetViewMatrix()); { WorldManager.DrawWorld(spriteBatch); UnitManager.DrawWorld(spriteBatch); ProjectileManager.Draw(spriteBatch); } spriteBatch.End(); // screen space spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, blendState: BlendState.AlphaBlend, samplerState: SamplerState.PointClamp); { UnitManager.DrawScreen(spriteBatch); Menu.Draw(spriteBatch); PUITooltipManager.Draw(spriteBatch); } spriteBatch.End(); }
protected override void LoadContent() { Content.RootDirectory = ""; IsMouseVisible = true; PandaMonogameConfig.Logging = true; PandaMonogameConfig.UISoundType = (int)SoundType.UI; ModManager.Instance.Init(Content); ModManager.Instance.LoadList("Mods", "mods.xml", "assets.xml"); ModManager.Instance.ImportAssets(); ModManager.Instance.AssetManager.Import("Assets\\assets.xml"); SettingsManager.Instance.Load("Assets\\settings.xml"); #if DEBUG IsFixedTimeStep = false; _graphics.SynchronizeWithVerticalRetrace = false; #endif _graphics.PreferredBackBufferWidth = SettingsManager.Instance.GetSetting <int>("window", "width"); _graphics.PreferredBackBufferHeight = SettingsManager.Instance.GetSetting <int>("window", "height"); _graphics.ApplyChanges(); ModManager.Instance.SoundManager.SetVolume((int)SoundType.Music, SettingsManager.Instance.GetSetting <float>("sound", "musicvolume")); ModManager.Instance.SoundManager.SetVolume((int)SoundType.SoundEffect, SettingsManager.Instance.GetSetting <float>("sound", "sfxvolume")); ModManager.Instance.SoundManager.SetVolume((int)SoundType.UI, SettingsManager.Instance.GetSetting <float>("sound", "uivolume")); Config.HelpSeen = SettingsManager.Instance.GetSetting <bool>("general", "helpseen"); _spriteBatch = new SpriteBatch(GraphicsDevice); Sprites.Load(GraphicsDevice); PUITooltipManager.Setup(GraphicsDevice, Sprites.DefaultFont); //ChangeGameState((int)GameStateType.Startup); ChangeGameState((int)GameStateType.Menu); Window.TextInput += Window_TextInput; }
public static void Cleanup() { LayeredSprite.Cleanup(); PUITooltipManager.Clear(); }