public void CenterMouse() { RGameWindow window = REngine.RGame.GameWindow; var x = window.Location.X + (window.ClientSize.Width / 2); var y = window.Location.Y + (window.ClientSize.Height / 2); RLog.Info(String.Format("Set MouseCenter to {0} {1}", x, y)); Mouse.SetPosition(x, y); }
/// <summary> /// Initializes a new instance of the <see cref="RGame"/> class. /// </summary> public RGame() { gameTime = new RGameTime(); startTime = DateTime.UtcNow; REngine.RGame = this; gameWindow = new RGameWindow(800, 600); REngine.Instance.SetViewport(new RViewport(0, 0, 800, 600)); gameWindow.RenderFrame += GameWindow_RenderFrame; gameWindow.UpdateFrame += GameWindow_UpdateFrame; gameWindow.Resize += GameWindow_Resize; gameWindow.Closed += gameWindow_Closed; gameWindow.VSync = VSyncMode.On; }
public void CenterMouse() { RGameWindow window = REngine.RGame.GameWindow; Mouse.SetPosition(window.Location.X + (window.Width / 2), window.Location.Y + (window.Height / 2)); }