MoveToScreen
Introduction
Calling MoveToScreen
this.MoveToScreen(typeof(GameScreen).FullName);this.MoveToScreen("GameScreen");this.MoveToScreen("YourProject.Screens.GameScreen");Resetting a Screen
// assuming there is a function to tell us if the player was hit by a bullet
// This also assumes that this code is written in the GameScreen and not in an entity
bool wasHitByBullet = GetIfHitByBullet();
if(wasHitByBullet)
{
// GetType returns the GameScreen's type
this.MoveToScreen(this.GetType());
}MoveToScreen destroys the Screen
"The Screen that was just unloaded did not clean up after itself" Exception
Passing information to new Screens
Last updated
Was this helpful?