コード例 #1
0
 /// <summary>
 /// Change the current digit for counting down.
 /// </summary>
 private void changeDigit()
 {
     m_timeToChange += 1;
     m_currentDigit--;
     Game.Components.Remove(m_subTitle);
     m_subTitle = new MenuLabel(Game, m_currentDigit.ToString());
     AddComponents(m_subTitle);
     Scale = sr_maxScale;
 }
コード例 #2
0
 /// <summary>
 /// TimerScreen consturcor.
 /// </summary>
 /// <param name="i_GameScreen">Game screen to cover.</param>
 /// <param name="i_Seconds">Seconds to release the timer cover screen.</param>
 /// <param name="i_MainTitle">Main title while counting down.</param>
 public TimerScreen(GameScreen i_GameScreen, int i_Seconds, string i_MainTitle)
     : base(i_GameScreen, false)
 {
     m_backgroundGameScreen.ScreenMode = eScreenMode.Visible;
     m_currentDigit = i_Seconds;
     m_length       = TimeSpan.FromSeconds(i_Seconds - 0.5f);
     m_mainTitle    = new MenuLabel(Game, i_MainTitle);
     AddComponents(m_mainTitle);
     m_subTitle = new MenuLabel(Game, m_currentDigit.ToString());
     AddComponents(m_subTitle);
 }
コード例 #3
0
 /// <summary>
 /// DarkScreenCover constructor.
 /// </summary>
 /// <param name="i_GameScreen">Background screen (which will be covered)</param>
 /// <param name="i_IsPausing">Is this cover pause the background screen updates?</param>
 public DarkScreenCover(GameScreen i_GameScreen, bool i_IsPausing = true)
     : base(i_GameScreen.ScreensManager, @"Screens\gradient")
 {
     m_isPausing            = i_IsPausing;
     m_backgroundGameScreen = i_GameScreen;
     if (i_IsPausing)
     {
         m_mainTitle = new MenuLabel(Game, "Pause");
         m_subTitle  = new MenuLabel(Game, "Press 'R' to resume");
         AddComponents(m_mainTitle, m_subTitle);
     }
 }
コード例 #4
0
ファイル: MenuScreen.cs プロジェクト: avivabou/SpaceInvaders
 /// <summary>
 /// MenuScreen constructor.
 /// </summary>
 /// <param name="i_ScreensManager">Screen manager.</param>
 /// <param name="i_Background">Background content name.</param>
 /// <param name="i_Title">Main title.</param>
 /// <param name="i_Options">Options strings.</param>
 /// <param name="i_Sound">Sound of any action.</param>
 public MenuScreen(ScreensManager i_ScreensManager, string i_Background, string i_Title, string[] i_Options, Enum i_Sound)
     : base(i_ScreensManager, i_Background)
 {
     m_title = new MenuLabel(Game, i_Title);
     m_title.SetColors(Color.Cyan, Color.Cyan);
     m_title.Enabled = false;
     AddComponents(m_title);
     m_menuCollection = new MenuCollection(Game, i_Options, getFittedOptionsRectangle());
     AddComponents(m_menuCollection);
     m_menuCollection.Selected = 0;
     m_sound = i_Sound;
     Game.Window.ClientSizeChanged += window_ClientSizeChanged;
 }
コード例 #5
0
        /// <summary>
        /// MenuCollection constructor.
        /// </summary>
        /// <param name="i_Game">Game.</param>
        /// <param name="i_MenuStrings">Array of strings which will present as Menu Labels.</param>
        /// <param name="i_ScreenBoundries">Screen bounderies for collection.</param>
        /// <param name="i_LinesGapProportion">Gap between lines as a scale of line.</param>
        public MenuCollection(Game i_Game, string[] i_MenuStrings, Rectangle?i_ScreenBoundries = null, float i_LinesGapProportion = 1)
            : base(i_Game)
        {
            m_menuLabels = new MenuLabel[i_MenuStrings.Length];
            for (int i = 0; i < m_menuLabels.Length; i++)
            {
                m_menuLabels[i] = new MenuLabel(Game, i_MenuStrings[i]);
            }

            m_linesGapProportion = i_LinesGapProportion - 1;
            if (i_ScreenBoundries.HasValue)
            {
                m_screenBoundries = i_ScreenBoundries.Value;
            }
            else
            {
                m_screenBoundries = new Rectangle(0, 0, Game.Window.ClientBounds.Width, Game.Window.ClientBounds.Height);
            }
        }