Skip to content

Customizing Window Close Behavior in Stride? #2399

Discussion options

You must be logged in to vote

So I've looked into this and below are my findings after some testing.

  1. Great stuff that you already found the solution for question 1.
    If it helps any, the way I found it most comfortable for me is that you open the MyGameApp.cs (your app's name and usually with the name ending in .Windows or .Linux or whatever platform you're building for) then you modify it with something along the lines:
using var game = new Game();
game.WindowCreated += Game_WindowCreated; // Perform logic only once after the window is created
game.Run();

void Game_WindowCreated(object sender, EventArgs e)
{
    game.Exiting += Game_Exiting; // Implement another method with the logic required. I haven't tested this…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@EsatMan
Comment options

You must be logged in to vote
2 replies
@EsatMan
Comment options

@FloccinaucinihilifilipicatesLongNames
Answer selected by EsatMan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants