public static bool InitializeEngine() { NetworkSocket.Initialize(); try { background = new EngineObject($"{Common.Configuration.GamePath}/Data/background.png", 1024, 768); background.Size = new Size2(1024, 768); background.SourceRect = new Rectangle(0, 0, 1024, 720); DataManager.Initialize(); WindowTalent.Initialize(); WindowSkill.Initialize(); WindowPin.Initialize(); WindowCash.Initialize(); WindowMail.Initialize(); WindowSelectedItem.Initialize(); WindowViewTalent.Initialize(); //Carrega os dados de classe. ClasseManager.Initialize(); //Carrega os dados de npc. NpcManager.OpenData(); //Carrega os dados de experiencia ExperienceManager.Read(); EngineFont.Initialize(); EngineMessageBox.Initialize(); EngineInputBox.Initialize(); EngineMultimedia.Initialize(); WindowLogin.Initialize(); WindowServer.Initialize(); WindowCharacter.Initialize(); WindowNewCharacter.Initialize(); WindowGame.Initialize(); WindowViewItem.Initialize(); // EngineMultimedia.PlayMusic(0, true); GameState = 1; return(true); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }
public static void Render() { if (Device == null) { return; } Device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0); Device.BeginScene(); background.Draw(); if (GameState == 1) { // WindowTalent.Visible = true; // WindowTalent.Draw(); // WindowViewTalent.Draw(); WindowLogin.Draw(); } if (GameState == 2) { WindowServer.Draw(); } if (GameState == 3) { WindowCharacter.Draw(); WindowPin.Draw(); } if (GameState == 4) { WindowNewCharacter.Draw(); } if (GameState == 6) { WindowGame.Draw(); } EngineInputBox.Draw(); EngineMessageBox.Draw(); EngineFont.DrawText("FPS: " + FPS, 925, 0, Color.Coral, EngineFontStyle.Bold); EngineFont.DrawText("Ping: " + Common.Configuration.Latency, 5, 0, Color.Coral, EngineFontStyle.Bold); Device.EndScene(); Device.Present(); }
public static bool InitializeEngine() { NetworkSocket.Initialize(); try { background = new EngineObject($"{Environment.CurrentDirectory}\\Data\\background.png", 1024, 768); background.Size = new Size2(1024, 768); background.SourceRect = new Rectangle(0, 0, 1024, 768); //Carrega os dados de classe. ClasseManager.Initialize(); //Carrega os dados de experiencia ExperienceManager.Experience.Initialize("experience"); EngineFont.Initialize(); EngineMessageBox.Initialize(); EngineInputBox.Initialize(); EngineMultimedia.Initialize(); WindowLogin.Initialize(); WindowServer.Initialize(); WindowCharacter.Initialize(); WindowNewCharacter.Initialize(); WindowGame.Initialize(); SpriteManager.Initialize(); EngineMultimedia.PlayMusic(0, true); GameState = 1; return(true); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }