protected override void OnUpdateFrame(FrameEventArgs e) { // called once per frame; app logic var keyboard = OpenTK.Input.Keyboard.GetState(); if (keyboard[OpenTK.Input.Key.Escape]) { this.Exit(); } var mouse = OpenTK.Input.Mouse.GetState(); Point p = CursorPosition.GetCursorPosition(); game.SetMouseState(p.X, p.Y, mouse.LeftButton == ButtonState.Pressed); }
protected override void OnUpdateFrame(FrameEventArgs e) { // called once per frame; app logic var keyboard = OpenTK.Input.Keyboard.GetState(); if (keyboard[OpenTK.Input.Key.Escape]) { this.Exit(); } var mouse = OpenTK.Input.Mouse.GetState(); Point p = CursorPosition.GetCursorPosition(); if (p.X > X && p.X <= X + Width && p.Y > Y && p.Y <= p.Y + Width) { game.SetMouseState(mouse, p.X, p.Y); } }