public override void Initialize() { m_curChildState = ChildState.ShowTeamlogoState; m_stateManager = StateManager.GetInstance(); m_showStoryTexPackaging = new ShowStoryTexPackaging(); m_showStoryTexPackaging.Initialize(); #region Initialize ScenceSprites #region Initialize the teamlogo m_teamlogo = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/Teamlogo/teamlogo" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), CurAlpha = 0.1f, FlashInterval = 0.008f, Visible = true, }; m_teamlogo.TColor = new Color( new Vector4( 255, 255, 255, m_teamlogo.CurAlpha ) ); m_teamlogo.SourceRect = new Rectangle( 0, 0, m_teamlogo.TextureImage.Width, m_teamlogo.TextureImage.Height ); #endregion #region Initialize the respectBackground m_respectBackground = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/RespectShow/b_0" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), CurAlpha = 0.0f, FlashInterval = 0.005f, Visible = true, }; m_respectBackground.TColor = new Color( new Vector4( 255, 255, 255, m_respectBackground.CurAlpha ) ); m_respectBackground.SourceRect = new Rectangle( 0, 0, m_respectBackground.TextureImage.Width, m_respectBackground.TextureImage.Height ); #endregion #region Initialize the respect word_1 m_word_1 = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/RespectShow/b_1" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), CurAlpha = 0.2f, FlashInterval = 0.005f, Visible = true, }; m_word_1.TColor = new Color( new Vector4( 255, 255, 255, m_word_1.CurAlpha ) ); m_word_1.SourceRect = new Rectangle( 0, 0, m_word_1.TextureImage.Width, m_word_1.TextureImage.Height ); #endregion #region Initialize the respect word_2 m_word_2 = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/RespectShow/b_2" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), CurAlpha = 0.005f, FlashInterval = 0.005f, Visible = true, }; m_word_2.TColor = new Color( new Vector4( 255, 255, 255, m_word_2.CurAlpha ) ); m_word_2.SourceRect = new Rectangle( 0, 0, m_word_2.TextureImage.Width, m_word_2.TextureImage.Height ); #endregion m_showTeamlogoCollection = new List<ISprite>(); m_showRespectCollection = new List<ISprite>(); #region Add the components to the m_showTeamlogoCollection m_showTeamlogoCollection.Add(m_teamlogo); #endregion #region Add the components to the m_showRespectCollection m_showRespectCollection.Add( m_respectBackground ); m_showRespectCollection.Add( m_word_1); m_showRespectCollection.Add( m_word_2 ); #endregion #endregion }
private void Init() { #region Initialize the packagings m_buttonPackaging = new ControlMenuButtonPackaging( SpriteManager.SpriteBatch ); m_buttonPackaging.Load(); m_keyShow = new ControlShowTexPackaging(); m_keyShow.Initialize(); #endregion #region Initialize background Textures #region Initialize the background m_background = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Background" ), TargetOffset = new Vector2( 2000, 3000 ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), Visible = true, TColor = Color.White }; m_background.SourceRect = new Rectangle( 0, 0, m_background.TextureImage.Width, m_background.TextureImage.Height ); #endregion #region Initialize the foreground m_foreground = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Foreground" ), TargetOffset = new Vector2( 2000, 3000 ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), Visible = true, TColor = Color.White }; m_foreground.SourceRect = new Rectangle( 0, 0, m_foreground.TextureImage.Width, m_foreground.TextureImage.Height ); #endregion #region Initialize the mist of background m_backgroundMist = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Mist" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), BeginingFlashInterval = 0.003f, CurAlpha = ScenceSprite.MinAlpha, Visible = true, }; m_backgroundMist.TColor = new Color( new Vector4( 255, 255, 255, m_backgroundMist.CurAlpha ) ); m_backgroundMist.SourceRect = new Rectangle( 0, 0, m_backgroundMist.TextureImage.Width, m_backgroundMist.TextureImage.Height ); #endregion #region Initialize the UFO light m_ufoLight = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/UFOLight" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), BeginingFlashInterval = 0.008f, CurAlpha = ScenceSprite.MinAlpha, Visible = true, }; m_ufoLight.TColor = new Color( new Vector4( 255, 255, 255, m_ufoLight.CurAlpha ) ); m_ufoLight.SourceRect = new Rectangle( 0, 0, m_ufoLight.TextureImage.Width, m_ufoLight.TextureImage.Height ); #endregion #region Initialize the dark player m_staticsDarkPlayer = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/DarkPlayer" ), TargetOffset = new Vector2( 2000, 3000 ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), Visible = true, TColor = Color.White }; m_staticsDarkPlayer.SourceRect = new Rectangle( 0, 0, m_staticsDarkPlayer.TextureImage.Width, m_staticsDarkPlayer.TextureImage.Height ); #endregion #endregion #region Add the components to the m_optionMenuCollection m_controlMenuCollection.Add( m_background ); m_controlMenuCollection.Add( m_foreground ); m_controlMenuCollection.Add( m_buttonPackaging ); m_controlMenuCollection.Add( m_ufoLight ); m_controlMenuCollection.Add( m_staticsDarkPlayer ); m_controlMenuCollection.Add( m_backgroundMist ); #endregion }
internal void Twinkle( ScenceSprite scenceSprite ) { if( scenceSprite.CurAlpha <= ScenceSprite.MaxAlpha ) { scenceSprite.TColor = new Color( 1f, 1f, 1f, (float)Math.Sin( scenceSprite.CurAlpha * Math.PI ) ); scenceSprite.CurAlpha += scenceSprite.FlashInterval; if( scenceSprite.CurAlpha >= ScenceSprite.MaxAlpha ) scenceSprite.CurAlpha = 0.0f; } }
public override void Initialize() { m_audioManager = AudioManager.GetInstance(); m_audioManager.LoadSong( "SongOfMainMenuGameState", DataReader.Load<Song>( "MusicAndSoundEffect/Song/MusicOfMenuState" ) ); //m_audioManager.PlaySong( "SongOfMainMenuGameState", true ); //m_audioManager.LoadSound("def", DataReader.Load<SoundEffect>("")); //m_audioManager.PlaySong( "SongOfMainMenuGameState", true ); //m_audioManager.StopSong(); //m_audioManager.FadeSong(1,new TimeSpan(0,0,1)); m_curChildState = ChildState.BeginState; m_beginStateCollection = new List<ISprite>(); m_gameLogoDisappearStateCollection = new List<ISprite>(); m_startMenuShowStateCollection = new List<ISprite>(); m_zoomInBackgroundStateCollection = new List<ISprite>(); m_capsuleOnTargetStateCollection = new List<ISprite>(); m_distortionStateCollection = new List<ISprite>(); m_effect = GraphicsManager.GetInstance(); m_stateManager = StateManager.GetInstance(); #region Initialize the tv pictures m_tvPicture_1 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVPicture_1", SpriteManager.SpriteBatch, "TVPicture_1" ); m_tvPicture_2 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _3", SpriteManager.SpriteBatch, "TVPicture_2" ); m_tvPicture_3 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVPicture_3", SpriteManager.SpriteBatch, "TVPicture_3" ); m_tvPicture_4 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _2", SpriteManager.SpriteBatch, "TVPicture_4" ); m_tvPicture_5 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _1", SpriteManager.SpriteBatch, "TVPicture_5" ); m_tvPicture_6 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVPicture_6", SpriteManager.SpriteBatch, "TVPicture_6" ); m_tvPicture_7 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVPicture_7", SpriteManager.SpriteBatch, "TVPicture_7" ); m_tvMessey_1 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _1", SpriteManager.SpriteBatch, "TVMessy _1" ); m_tvMessey_2 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _2", SpriteManager.SpriteBatch, "TVMessy _2" ); m_tvMessey_3 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _3", SpriteManager.SpriteBatch, "TVMessy _3" ); m_tvPictureList = new List<DButton>(); //m_tvMesseyList = new List<DButton>(); m_tvPictureList.Add( m_tvPicture_1 ); m_tvPictureList.Add( m_tvPicture_2 ); m_tvPictureList.Add( m_tvPicture_3 ); m_tvPictureList.Add( m_tvPicture_4 ); m_tvPictureList.Add( m_tvPicture_5 ); m_tvPictureList.Add( m_tvPicture_6 ); m_tvPictureList.Add( m_tvPicture_7 ); m_tvPictureList.Add( m_tvMessey_1 ); m_tvPictureList.Add( m_tvMessey_2 ); m_tvPictureList.Add( m_tvMessey_3 ); #endregion m_logo = new ScenceSprite(); m_logo.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/GameLogo" ); m_startString = new ScenceSprite(); m_startString.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/press_0" ); m_buttonPackaging = new MainMenuButtonPackaging( SpriteManager.SpriteBatch ); m_background = new ScenceSprite(); m_background.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Background" ); m_foreground = new ScenceSprite(); m_foreground.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Foreground" ); m_backgroundMist = new ScenceSprite(); m_backgroundMist.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Mist" ); m_ufoLight = new ScenceSprite(); m_ufoLight.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/UFOLight" ); #region Initialize the statics player m_staticsDarkPlayer = new ScenceSprite(); m_staticsDarkPlayer.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/DarkPlayer" ); #region Initial the glowing player m_staticsGlowingPlayer = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/GlowingPlayer" ), TargetOffset = new Vector2( 2000, 3000 ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), Visible = true, TColor = Color.White }; m_staticsGlowingPlayer.SourceRect = new Rectangle( 0, 0, m_staticsGlowingPlayer.TextureImage.Width, m_staticsGlowingPlayer.TextureImage.Height ); #endregion #endregion #region Initialize the tips button "Enter" m_tipsButton = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/press_1" ), Position = new Vector2( 420, 125 ), Visible = true, TColor = Color.White }; m_tipsButton.DestRect = new Rectangle( (int)m_tipsButton.Position.X, (int)m_tipsButton.Position.Y, (int)( m_tipsButton.TextureImage.Width * 0.25 ), (int)( m_tipsButton.TextureImage.Height * 0.25 ) ); m_tipsButton.SourceRect = new Rectangle( 0, 0, m_tipsButton.TextureImage.Width, m_tipsButton.TextureImage.Height ); #endregion InitLogic(); #region Add the components to the m_beginStateCollection m_beginStateCollection.Add( m_background ); m_beginStateCollection.Add( m_foreground ); m_beginStateCollection.Add( m_backgroundMist ); m_beginStateCollection.Add( m_staticsDarkPlayer ); m_beginStateCollection.Add( m_logo ); m_beginStateCollection.Add( m_startString ); #endregion #region Add the components to the m_gameLogoDisappearStateCollection m_gameLogoDisappearStateCollection.Add( m_background ); m_gameLogoDisappearStateCollection.Add( m_foreground ); m_gameLogoDisappearStateCollection.Add( m_staticsDarkPlayer ); m_gameLogoDisappearStateCollection.Add( m_backgroundMist ); #endregion #region Add the components to the m_startMenuShowStateCollection m_startMenuShowStateCollection.Add( m_background ); m_startMenuShowStateCollection.Add( m_foreground ); m_startMenuShowStateCollection.Add( m_buttonPackaging ); m_startMenuShowStateCollection.Add( m_ufoLight ); m_startMenuShowStateCollection.Add( m_staticsDarkPlayer ); m_startMenuShowStateCollection.Add( m_backgroundMist ); #endregion #region Add the components to the m_zoomInBackgroundStateCollection m_zoomInBackgroundStateCollection.Add( m_background ); m_zoomInBackgroundStateCollection.Add( m_foreground ); m_zoomInBackgroundStateCollection.Add( m_ufoLight ); m_zoomInBackgroundStateCollection.Add( m_staticsDarkPlayer ); m_zoomInBackgroundStateCollection.Add( m_backgroundMist ); #endregion #region Add the components to the m_capsuleOnTargetStateCollection m_capsuleOnTargetStateCollection.Add( m_background ); foreach( var a in m_tvPictureList ) { m_capsuleOnTargetStateCollection.Add( a ); } m_capsuleOnTargetStateCollection.Add( m_foreground ); m_capsuleOnTargetStateCollection.Add( m_tipsButton ); m_capsuleOnTargetStateCollection.Add( m_ufoLight ); m_capsuleOnTargetStateCollection.Add( m_staticsGlowingPlayer ); m_capsuleOnTargetStateCollection.Add( m_backgroundMist ); #endregion #region Add the components to the m_distortionStateCollection m_distortionStateCollection.Add( m_background ); foreach( var a in m_tvPictureList ) { m_distortionStateCollection.Add( a ); } m_distortionStateCollection.Add( m_foreground ); m_distortionStateCollection.Add( m_backgroundMist ); m_distortionStateCollection.Add( m_staticsGlowingPlayer ); #endregion this.GameStateChanged += new GameStateEventHandler( MainMenuGameState_GameStateChanged ); }