public override void Initialize() { this.game = new TeapotSample.Game(); this.game.Initialize(this); #region WAVE SOFTWARE LICENSE AGREEMENT this.backgroundSplashColor = new Color("#ebebeb"); this.spriteBatch = new SpriteBatch(WaveServices.GraphicsDevice); var resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames(); string name = string.Empty; foreach (string item in resourceNames) { if (item.Contains("SplashScreen.png")) { name = item; break; } } if (string.IsNullOrWhiteSpace(name)) { throw new InvalidProgramException("License terms not agreed."); } using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name)) { this.splashScreen = Texture2D.FromFile(WaveServices.GraphicsDevice, stream); } #endregion }
/// <summary> /// On Initialized method /// </summary> /// <param name="sender">sender object</param> /// <param name="e">game instance</param> protected virtual void OnInitialized(object sender, ProjectGame e) { if (this.Initialized != null) { this.Initialized(this, this.gameApp); } }
public override void Initialize() { this.game = new TeapotSample.Game(); this.game.Initialize(this); #region WAVE SOFTWARE LICENSE AGREEMENT this.backgroundSplashColor = new Color("#ebebeb"); this.spriteBatch = new SpriteBatch(WaveServices.GraphicsDevice); var resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames(); string name = string.Empty; foreach (string item in resourceNames) { if (item.Contains("SplashScreen.wpk")) { name = item; break; } } if (string.IsNullOrWhiteSpace(name)) { throw new InvalidProgramException("License terms not agreed."); } using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name)) { this.splashScreen = WaveServices.Assets.Global.LoadAsset<Texture2D>(name, stream); } #endregion }
public override void Initialize() { base.Initialize(); // Initialize game = new TeapotSample.Game(); game.Initialize(this); }
/// <summary> /// Perform further custom initialize for this instance. /// </summary> /// <exception cref="System.InvalidProgramException">License terms not agreed.</exception> public override void Initialize() { this.Game = new ProjectGame(); this.Game.Initialize(this); #region WAVE SOFTWARE LICENSE AGREEMENT this.backgroundSplashColor = new Color("#ebebeb"); this.spriteBatch = new SpriteBatch(WaveServices.GraphicsDevice); var resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames(); string name = string.Empty; foreach (string item in resourceNames) { if (item.Contains("SplashScreen.wpk")) { name = item; break; } } if (string.IsNullOrWhiteSpace(name)) { throw new InvalidProgramException("License terms not agreed."); } using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name)) { this.splashScreen = WaveServices.Assets.Global.LoadAsset <Texture2D>(name, stream); } position = new Vector2(); position.X = (this.Width / 2.0f) - (this.splashScreen.Width / 2.0f); position.Y = (this.Height / 2.0f) - (this.splashScreen.Height / 2.0f); #endregion }
/// <summary> /// On Initialized method /// </summary> /// <param name="sender">sender object</param> /// <param name="e">game instance</param> protected virtual void OnInitialized(object sender, ProjectGame e) { if (this.Initialized != null) { this.Initialized(this, this.gameApp); } }