public virtual AbstractScreen[] AsArray() { var screens = new AbstractScreen[Screens.Count]; Screens.CopyTo(screens, 0); return(screens); }
/// <summary> /// Adds a new Screen to the List /// </summary> /// <param name="screen"></param> /// <param name="closeScreen"></param> /// <exception cref="Exception">Screen missing name</exception> public virtual AbstractScreen Add(AbstractScreen screen, AbstractScreen closeScreen = null) { if (closeScreen != null) { closeScreen.ExitScreen(); } // @TODO: Why should the screen state default to hidden? //screen.ScreenState = EScreenState.Hidden; if (string.IsNullOrEmpty(screen.Name)) { throw new Exception("Screen missing name"); } if (mIsInitialized) { screen.Initialize(); } if (mContentLoaded) { screen.LoadContent(); } lock (mScreens) { mScreensToAdd.Add(screen); } return(screen); }
public override void Draw(AbstractScreen screen, GameTime gameTime) { SpriteBatch.Begin(); base.Draw(screen, gameTime); SpriteBatch.End(); }
/// <summary> /// Removes a Screen from the List /// </summary> /// <param name="screen"></param> public virtual void Remove(AbstractScreen screen) { if (mContentLoaded) { screen.UnloadContent(); } lock (mScreens) { mScreens.Remove(screen.Name); } }
public virtual AbstractScreen[] AsArray() { var screens = new AbstractScreen[Screens.Count]; Screens.CopyTo(screens, 0); return screens; }
/// <summary> /// Removes a Screen from the List /// </summary> /// <param name="screen"></param> public virtual void Remove(AbstractScreen screen) { if (mContentLoaded) { screen.UnloadContent(); } lock (mScreens) { mScreens.Remove(screen.Name); } }
/// <summary> /// Adds a new Screen to the List /// </summary> /// <param name="screen"></param> /// <param name="closeScreen"></param> /// <exception cref="Exception">Screen missing name</exception> public virtual AbstractScreen Add(AbstractScreen screen, AbstractScreen closeScreen = null) { if (closeScreen != null) { closeScreen.ExitScreen(); } // @TODO: Why should the screen state default to hidden? //screen.ScreenState = EScreenState.Hidden; if (string.IsNullOrEmpty(screen.Name)) { throw new Exception("Screen missing name"); } if (mIsInitialized) { screen.Initialize(); } if (mContentLoaded) { screen.LoadContent(); } lock (mScreens) { mScreensToAdd.Add(screen); } return screen; }
/// <summary> /// Draws a single screen for the given gameTime /// </summary> /// <param name="screen"></param> /// <param name="gameTime"></param> public virtual void Draw(AbstractScreen screen, GameTime gameTime) { SpriteBatch.Begin(); screen.Draw(gameTime); SpriteBatch.End(); }
/// <summary> /// Draws a single screen for the given gameTime /// </summary> /// <param name="screen"></param> /// <param name="gameTime"></param> public virtual void Draw(AbstractScreen screen, GameTime gameTime) { SpriteBatch.Begin(); screen.Draw(gameTime); SpriteBatch.End(); }