Exemple #1
0
        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
        }
Exemple #2
0
 /// <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);
     }
 }
Exemple #3
0
        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
        }
Exemple #4
0
        public override void Initialize()
        {
            base.Initialize();

            // Initialize
            game = new TeapotSample.Game();
            game.Initialize(this);
        }
Exemple #5
0
        /// <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
        }
Exemple #6
0
 /// <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);
     }
 }