public override void LoadContent() { ProtoHelper.OnChatRecieve += OnChatRecive; _ = ProtoHelper.JoinToChatAsync(); var camera = new OrthographicCamera(_sceneHandler._graphicsDevice); mouseSystem = new MouseSystem(); MouseSystem.OnMouseLeftClick += mouseClick; spriteBatch = new SpriteBatch(_sceneHandler._graphicsDevice); world = new WorldBuilder() .AddSystem(new RenderSystem(spriteBatch, camera)) .AddSystem(mouseSystem) .Build(); _sceneHandler._gameComponents.Add(world); entityFactory = new EntityFactory(world, _sceneHandler._content, _sceneHandler._graphicsDevice); text = entityFactory.CreateText(new Vector2(100, 100), ProtoHelper.nickname, 100); playerReadyButtom = entityFactory.CreateReadySign(new Vector2(500, 110)); readyText = entityFactory.CreateText(new Vector2(530, 102), "Not ready", 0); enemyText = entityFactory.CreateText(new Vector2(100, 200), "", 100); enemyReadyButtom = entityFactory.CreateReadySign(new Vector2(500, 210)); enemyReadyText = entityFactory.CreateText(new Vector2(530, 202), "Not ready", 0); LoadGui(); while (!ProtoHelper.IsChatLive) { Thread.Sleep(10); } Thread.Sleep(500); ProtoHelper.WriteToChat("!live"); while (live == null) { Thread.Sleep(10); } if ((bool)live == true) { ChangeStateToGame(); } var player = _sceneHandler._content.Load <Texture2D>("MiniHead1"); var upArrow = _sceneHandler._content.Load <Texture2D>("MiniHead1"); playerSprite = new Sprite(player); enemySprite = new Sprite(player); upArrowSprite = new Sprite(_sceneHandler._content.Load <Texture2D>("upArrow")); downArrowSprite = new Sprite(_sceneHandler._content.Load <Texture2D>("downArrow")); }
private void SystemInitialize() { AudioSystemControl = new AudioSystem(music, sounds, audioSource); MouseSystemControl = new MouseSystem(cursors); InputSystemControl = new InputSystem(); SlingSystemControl = new SlingSystem(); CameraSystemControl = new CameraSystem(); BirdControlSystemControl = new BirdControlSystem(); ScoreSystemControl = new ScoreSystem(); JudgeSystemControl = new JudgeSystem(); }
private void MakeScreenShot() { try { InternalWindow.WindowState = WindowState.Minimized; var screen = ScreenShotSystem.GetScreenshot(); InternalWindow.WindowState = WindowState.Normal; AddScreenShot(screen); MouseSystem.ResetCurrentAction(); } catch (Exception ex) { Logger.Error(ex.ToString()); } }
private void OnSelectionWindow(SSPayload<bool> ssPayload) { MouseSystem.ResetCurrentAction(); if (ssPayload.Value) { var selectedWindow = MouseSystem.GetSelectedWindow(); System.Diagnostics.Debug.WriteLine(string.Format("SelectedWindow: {0}", selectedWindow)); var activeWnd = ScreenShotSystem.GetScreenshtOfSelectedWindow(selectedWindow); AddScreenShot(activeWnd); } else { System.Diagnostics.Debug.WriteLine(string.Format("SelectedWindow was canceled...")); } InternalWindow.WindowState = WindowState.Normal; }
private void OnSelectionArea(SSPayload<bool> result) { try { if (result.Value) { var region = MouseSystem.GetSelectedArea(); var selectedArea = ScreenShotSystem.GetScreenshotOfSelectedArea( new System.Drawing.Point((int)region.Item1.X, (int)region.Item1.Y), new System.Drawing.Point((int)region.Item2.X, (int)region.Item2.Y)); AddScreenShot(selectedArea); } InternalWindow.WindowState = WindowState.Normal; MouseSystem.ResetCurrentAction(); } catch (Exception ex) { Logger.Error(ex.ToString()); } }
private void MakeScreenShotOfSelectedArea() { InternalWindow.WindowState = WindowState.Minimized; MouseSystem.RunSelectingArea(); }
private void MakeScreenShotOfSelectedWindow() { InternalWindow.WindowState = WindowState.Minimized; MouseSystem.RunSelectingWindow(IntPtr.Zero); }