/// <summary> /// Private constructor; loading screens should be activated via the static Load /// method instead /// </summary> /// <param name="aScreenManager"></param> /// <param name="mLoadingIsSlow"></param> /// <param name="aScreensToLoad"></param> private LoadingScreen(ScreenManager aScreenManager, bool aLoadingIsSlow, GameScreen[] aScreensToLoad) { mLoadingIsSlow = aLoadingIsSlow; mScreensToLoad = aScreensToLoad; TransitionOnTime = TimeSpan.FromSeconds(0.5); }
public Hud(ScreenManager aScreenManager) { if (aScreenManager == null) { throw new ArgumentNullException("screenManager"); } mScreenManager = aScreenManager; }
/// <summary> /// Activates the loading screen. Will transition all currently active screens off. /// </summary> /// <param name="aScreenManager"></param> /// <param name="aLoadingIsSlow"></param> /// <param name="aScreensToLoad"></param> public static void Load(ScreenManager aScreenManager, bool aLoadingIsSlow, params GameScreen[] aScreensToLoad) { //Tell all the current screens to transition off foreach(GameScreen lScreen in aScreenManager.GetScreens()) { lScreen.ExitScreen(); } //Create and activate the loading screen LoadingScreen lLoadingScreen = new LoadingScreen(aScreenManager, aLoadingIsSlow, aScreensToLoad); aScreenManager.AddScreen(lLoadingScreen); }
public TowerDefense() { //Init the graphics system mGraphics = new GraphicsDeviceManager(this); mGraphics.PreferredBackBufferWidth = SCREEN_WIDTH; mGraphics.PreferredBackBufferHeight = SCREEN_HEIGHT; //Configure the content manager Content.RootDirectory = "Content"; //add a gamer-services component, which is required for storage APIs Components.Add(new GamerServicesComponent(this)); //TODO: Add the audio manager /** * AudioManager.Initialize(this, @"Content\Audio\RpgAudio.xgs", @"Content\Audio\Wave Bank.xwb", @"Content\Audio\Sound Bank.xsb"); * */ mScreenManager = new ScreenManager(this); Components.Add(mScreenManager); }