Hello to all,
I am completely new to Monogame so I apologise if the question is too simplistic or this is the wrong place.
I have just started translating my game from Pygame to Monogame and am a bit confused about the Initialize method. My understanding is that the method is only called once. I now have a method in my Game class that prevents the screen from scaling below a certain value:
void Window_ClientSizeChanged(object sender, EventArgs e) { _graphics.PreferredBackBufferWidth = Window.ClientBounds.Width; _graphics.PreferredBackBufferHeight = Window.ClientBounds.Height; if (_graphics.PreferredBackBufferWidth < 1024) { _graphics.PreferredBackBufferWidth = 1024; } if (_graphics.PreferredBackBufferHeight < 768) { _graphics.PreferredBackBufferHeight = 768; } _graphics.ApplyChanges(); }
The method is called in the Initialize method:
Window.ClientSizeChanged += new EventHandler(Window_ClientSizeChanged);
This also works as it should, I am just trying to understand why. Actually, in my understanding, this call should be made in the Update method, from where it also works. Is it possible that the Initialize method is also called continuously?