xna 4.0 - XNA how to check if the game window cross "X" is clicked -
Hi creating a game for Windows PC using XNA and when I click the "X" across the game window I want to check, so instead of pulling a menu I can do other things instead of closing the game.
So yes, how can I check the cross-click?
Thank you!
XNA needs nothing special, you can do it without it like that.
In your Then using this Start or
LoadContent method, your form is used for reference in Windows Form, and need to find a
Conclusion Event on that.
form form = form. Form farmland (window.handle) form; Form.FormClosing + = OnClosing;
OnClosing method, you can cancel the closest event, and run your own menu screen. (Possibly by changing the game state and drawing some more)
zero on-closing (Object Sender, FormClosingEventArgs e) {e.Cancel = true; ShowMenuScreen (); }
Comments
Post a Comment