void DrawSignInBlurb(string text)
    {
        bool  authenticated = GameManager.Instance.Authenticated;
        float x             = authenticated ? 0.0f : GameConsts.Menu.SignInBlurbX;

        // draw sign in explanation text
        Gu.SetColor(authenticated ? GameConsts.Menu.SignedInBlurbColor :
                    GameConsts.Menu.SignInBlurbColor);
        Gu.Label(Gu.Center(x),
                 Gu.Bottom(GameConsts.Menu.SignInBlurbY),
                 Gu.Dim(GameConsts.Menu.SignInBlurbFontSize),
                 text);
    }
Exemplo n.º 2
0
    public void DrawPilotInfo()
    {
        Gu.SetColor(Color.black);
        PilotStats stats    = GameManager.Instance.Progress.CurPilotStats;
        float      fontSize = SmallFormat ? GameConsts.Menu.PilotInfoFontSizeSmall :
                              GameConsts.Menu.PilotInfoFontSize;
        float y = SmallFormat ? GameConsts.Menu.PilotInfoYSmallFont :
                  GameConsts.Menu.PilotInfoY;

        // show summary info
        string summary;

        if (GameManager.Instance.Progress.IsMaxLevel())
        {
            summary = string.Format(Strings.ExpStringMaxLevel,
                                    stats.Level, stats.Title,
                                    GameManager.Instance.Progress.PilotExperience);
        }
        else
        {
            summary = string.Format(Strings.ExpString,
                                    stats.Level, stats.Title,
                                    GameManager.Instance.Progress.PilotExperience,
                                    GameManager.Instance.Progress.GetExpForNextLevel());
        }

        if (ShowPilotLevel)
        {
            Gu.Label(Gu.Left(GameConsts.Menu.PilotInfoX),
                     Gu.Top(y), Gu.Dim(fontSize),
                     summary, false);
        }

        if (!SmallFormat)
        {
            int total = GameManager.Instance.Progress.TotalScore;
            int stars = GameManager.Instance.Progress.TotalStars;
            Gu.Label(Gu.Right(GameConsts.Menu.TotalScoreLabelX),
                     Gu.Top(GameConsts.Menu.TotalScoreLabelY),
                     Gu.Dim(GameConsts.Menu.TotalScoreLabelFontSize),
                     Strings.TotalScore);
            Gu.Label(Gu.Right(GameConsts.Menu.TotalScoreX),
                     Gu.Top(GameConsts.Menu.TotalScoreY),
                     Gu.Dim(GameConsts.Menu.TotalScoreFontSize),
                     total.ToString("D7"));
            Gu.Label(Gu.Right(GameConsts.Menu.StarsX),
                     Gu.Top(GameConsts.Menu.StarsY),
                     Gu.Dim(GameConsts.Menu.StarsFontSize),
                     string.Format(Strings.TotalStarsFmt, stars));
        }
    }
Exemplo n.º 3
0
    bool DrawLbButton()
    {
        float w = GameConsts.Menu.LbButtonWidth;
        float h = GameConsts.Menu.LbButtonHeight;
        float x = GameConsts.Menu.LbButtonX;
        float y = GameConsts.Menu.LbButtonY;

        return(Gu.Button(Gu.Center(x),
                         (int)Util.Interpolate(0.0f, Screen.height, 1.0f, Gu.Middle(y),
                                               mTransition.NormalizedElapsed),
                         Gu.Dim(w), Gu.Dim(h),
                         Gu.Dim(GameConsts.Menu.LbFontSize),
                         Strings.Leaderboards));
    }
Exemplo n.º 4
0
    bool DrawPlayButton()
    {
        float w = GameConsts.Menu.PlayButtonWidth;
        float h = GameConsts.Menu.PlayButtonHeight;

        Gu.SetColor(Color.white);
        return(Gu.Button(
                   Gu.Center(-w / 2),
                   (int)Util.Interpolate(0.0f, Screen.height, 1.0f, Gu.Middle(-h / 2),
                                         mTransition.NormalizedElapsed),
                   Gu.Dim(w), Gu.Dim(h),
                   Gu.Dim(GameConsts.Menu.PlayButtonFontSize),
                   Strings.Play));
    }
Exemplo n.º 5
0
        void DrawHud()
        {
            Gu.SetColor(Color.black);

            // draw score
            Gu.Label(Gu.Right(GameConsts.Hud.ScoreX), Gu.Top(GameConsts.Hud.ScoreY),
                     Gu.Dim(GameConsts.Hud.ScoreFontSize), ((int)mDisplayedScore.Value).ToString("D5"));

            // draw % level complete
            int pc = Util.Clamp((int)(mLevelTime.NormalizedElapsed * 100), 0, 100);

            if (mGameState == GameState.Playing && pc == 100)
            {
                // while playing, we never get to 100% :-D
                pc = 99;
            }

            // draw level # and % complete
            Gu.Label(Gu.Left(GameConsts.Hud.StageX), Gu.Bottom(GameConsts.Hud.StageY),
                     Gu.Dim(GameConsts.Hud.StageFontSize),
                     string.Format(Strings.StageFmt, Util.GetLevelLetter(GameManager.Instance.Level),
                                   pc));

            // draw accuracy
            Gu.Label(Gu.Right(GameConsts.Hud.AccuracyX), Gu.Top(GameConsts.Hud.AccuracyY),
                     Gu.Dim(GameConsts.Hud.AccuracyFontSize),
                     string.Format(Strings.AccuracyFmt, GetAccuracyPercent()));

            // draw combo counter
            if (mCombo > 1 && Util.BlinkFunc(GameConsts.BlinkPeriod, 0.0f))
            {
                Gu.SetColor(GameConsts.Hud.ComboColor);
                Gu.Label(Gu.Center(GameConsts.Hud.ComboX), Gu.Top(GameConsts.Hud.ComboY),
                         Gu.Dim(GameConsts.Hud.ComboFontSize),
                         string.Format(Strings.ComboFmt, GetComboMult()));
            }

            // if there's a message being displayed, draw it now
            if (mMessageCd.Active && mMessage != null)
            {
                Gu.SetColor(0.0f, 0.0f, 0.0f,
                            Util.Trapezoid(GameConsts.Hud.MessageDuration,
                                           GameConsts.Hud.MessageTransitionDuration, mMessageCd.Elapsed));
                Gu.Label(Gu.Center(0), Gu.Middle(0),
                         Gu.Dim(GameConsts.Hud.MessageFontSize), mMessage);
            }
        }
Exemplo n.º 6
0
        void OnGUI()
        {
            if (Time.timeScale == 0)
            {
                return;
            }

            if (DelayBeforeStart > 0)
            {
                return;
            }

            GUI.skin = GuiSkin;
            switch (phase)
            {
            case 0:
                float aspect = ArrowTex.width / (float)ArrowTex.height;
                GUI.DrawTexture(new Rect(Gu.Left(GameConsts.Tutorial.SteerArrowX),
                                         Gu.Top(0), aspect * Screen.height,
                                         (int)(mTransitionCd.NormalizedElapsed * Screen.height)), ArrowTex);
                Gu.Label(
                    Gu.Left(GameConsts.Tutorial.SteerTextX),
                    (int)Util.Interpolate(0.0f, 0.0f, 1.0f, Gu.Middle(0),
                                          mTransitionCd.NormalizedElapsed),
                    Gu.Dim(GameConsts.Tutorial.FontSize),
                    Strings.Tutorial1);
                break;

            case 1:
                Gu.Label(Gu.Right(GameConsts.Tutorial.FireTextX),
                         (int)Util.Interpolate(0.0f, Screen.height, 1.0f, Gu.Middle(0),
                                               mTransitionCd.NormalizedElapsed),
                         Gu.Dim(GameConsts.Tutorial.FontSize),
                         Strings.Tutorial2);
                break;

            default:
                Gu.Label(Gu.Center(0),
                         (int)(Util.Interpolate(0.0f, 0.0f, 1.0f, Gu.Middle(0),
                                                mTransitionCd.NormalizedElapsed)),
                         Gu.Dim(GameConsts.Tutorial.FontSize),
                         Strings.Tutorial3);
                break;
            }
        }
Exemplo n.º 7
0
        void OnGUI()
        {
            GUI.skin = GuiSkin;
            Gu.SetColor(Color.black);
            Gu.Label(Gu.Center(GameConsts.EndScreen.EndTextX),
                     (int)Util.Interpolate(0.0f, Screen.height, 1.0f,
                                           Gu.Middle(GameConsts.EndScreen.EndTextY),
                                           mTransitionCd.NormalizedElapsed),
                     Gu.Dim(GameConsts.EndScreen.EndTextFontSize),
                     Strings.EndText, false);

            bool wantOut = DrawUpButton();

            if (mTransitionCd.Expired && wantOut)
            {
                GameManager.Instance.QuitToMenu();
            }
        }
    bool DrawLevelButton(int levelNo, int col, int row)
    {
        LevelProgress lp = GameManager.Instance.Progress.GetLevelProgress(levelNo);

        if (lp == null)
        {
            return(false);
        }

        float centerX = StartX + Stride * col;
        float centerY = StartY + Stride * row;

        centerX = Util.Interpolate(0.0f, 0.0f, 1.0f, centerX, mTransition.NormalizedElapsed);

        float left = centerX - LevelSize * 0.5f;
        float top  = centerY - LevelSize * 0.5f;

        if (GameManager.Instance.Progress.IsLevelUnlocked(levelNo))
        {
            Gu.SetColor(Color.white);
            bool r = Gu.Button(Gu.Center(left), Gu.Middle(top),
                               Gu.Dim(LevelSize), Gu.Dim(LevelSize),
                               Gu.Dim(LevelFontSize), Util.GetLevelLetter(levelNo));
            Gu.SetColor(Color.white);

            if (lp.Cleared)
            {
                Gu.Label(Gu.Center(centerX + ScoreOffsetX), Gu.Middle(centerY + ScoreOffsetY),
                         Gu.Dim(ScoreFontSize), lp.Score.ToString("D5"));
                Gu.Label(Gu.Center(centerX + ScoreOffsetX), Gu.Middle(centerY - ScoreOffsetY),
                         Gu.Dim(ScoreFontSize), Util.MakeStars(lp.Stars));
            }
            return(r);
        }
        else
        {
            GUI.DrawTexture(new Rect(Gu.Center(left), Gu.Middle(top),
                                     Gu.Dim(LevelSize), Gu.Dim(LevelSize)), DisabledTex);
            return(false);
        }
    }
Exemplo n.º 9
0
 void DrawBuildString()
 {
     Gu.SetColor(Color.black);
     Gu.Label(Gu.Left(GameConsts.Menu.BuildStringX), Gu.Bottom(GameConsts.Menu.BuildStringY),
              Gu.Dim(GameConsts.Menu.BuildStringFontSize), Strings.BuildString, false);
 }
Exemplo n.º 10
0
 void DrawPleaseWait()
 {
     Gu.SetColor(Color.black);
     Gu.Label(Gu.Center(0), Gu.Middle(0), Gu.Dim(GameConsts.Menu.PleaseWaitFontSize),
              GameManager.Instance.AuthProgressMessage);
 }